pub struct MemoryRequest<'a> { /* private fields */ }runtime only.Expand description
A request to a MemoryCreator::new_memory.
Implementations§
Source§impl<'a> MemoryRequest<'a>
impl<'a> MemoryRequest<'a>
Sourcepub fn ty(&self) -> MemoryType
pub fn ty(&self) -> MemoryType
Sourcepub fn minimum(&self) -> usize
pub fn minimum(&self) -> usize
Minimum size of the memory in bytes.
Same as the minimum of ty, but in bytes.
Sourcepub fn maximum(&self) -> Option<usize>
pub fn maximum(&self) -> Option<usize>
Limit on the maximum size of the memory in bytes, if any.
Same as the maximum of ty, but in bytes.
Sourcepub fn reserved_size_in_bytes(&self) -> usize
pub fn reserved_size_in_bytes(&self) -> usize
Indicates the expected size of the reservation that is to be made for this memory. The implementation must reserve this many bytes for the memory’s allocation, plus the guard size at the end. Note that this reservation need only be a virtual memory reservation, physical memory does not need to be allocated immediately.
If this value is not zero, grow_to should never move the base pointer and
the maximum size of ty is guaranteed to fit within reserved_size_in_bytes.
This value is tuned from the various Config methods about
memory sizes/guards. It is guaranteed to be a multiple of the system page size.
Sourcepub fn guard_size_in_bytes(&self) -> usize
pub fn guard_size_in_bytes(&self) -> usize
Indicates how many bytes of space after the memory allocation is expected to be unmapped. JIT code will
elide bounds checks based on the guard_size_in_bytes provided, so for
JIT code to work correctly the memory returned will need to be properly
guarded with guard_size_in_bytes bytes left unmapped after the base
allocation.
This value is tuned from the various Config methods about
memory sizes/guards. It is guaranteed to be a multiple of the system page size.
Sourcepub fn kind(&self) -> MemoryKind
pub fn kind(&self) -> MemoryKind
What kind of memory is requested.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MemoryRequest<'a>
impl<'a> RefUnwindSafe for MemoryRequest<'a>
impl<'a> Send for MemoryRequest<'a>
impl<'a> Sync for MemoryRequest<'a>
impl<'a> Unpin for MemoryRequest<'a>
impl<'a> UnsafeUnpin for MemoryRequest<'a>
impl<'a> UnwindSafe for MemoryRequest<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more