pub struct WasmMemoryConfig {
pub initial_pages: u32,
pub maximum_pages: Option<u32>,
pub shared: bool,
pub growth_strategy: MemoryGrowthStrategy,
pub alignment: MemoryAlignment,
}
Expand description
WebAssembly memory configuration
Fields§
§initial_pages: u32
Initial memory pages (64KB each)
maximum_pages: Option<u32>
Maximum memory pages
Shared memory (for threading)
growth_strategy: MemoryGrowthStrategy
Memory growth strategy
alignment: MemoryAlignment
Memory alignment
Implementations§
Source§impl WasmMemoryConfig
impl WasmMemoryConfig
Sourcepub fn new(initial_pages: u32, maximum_pages: Option<u32>) -> Self
pub fn new(initial_pages: u32, maximum_pages: Option<u32>) -> Self
Create a new memory configuration
Sourcepub fn multithreaded() -> Self
pub fn multithreaded() -> Self
Create a configuration for multi-threaded execution
Sourcepub fn initial_size_bytes(&self) -> usize
pub fn initial_size_bytes(&self) -> usize
Get total initial memory size in bytes
Sourcepub fn max_size_bytes(&self) -> Option<usize>
pub fn max_size_bytes(&self) -> Option<usize>
Get maximum memory size in bytes
Sourcepub fn supports_growth(&self) -> bool
pub fn supports_growth(&self) -> bool
Check if configuration supports growth
Sourcepub fn is_large_model_config(&self) -> bool
pub fn is_large_model_config(&self) -> bool
Check if configuration is suitable for large models
Trait Implementations§
Source§impl Clone for WasmMemoryConfig
impl Clone for WasmMemoryConfig
Source§fn clone(&self) -> WasmMemoryConfig
fn clone(&self) -> WasmMemoryConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WasmMemoryConfig
impl Debug for WasmMemoryConfig
Auto Trait Implementations§
impl Freeze for WasmMemoryConfig
impl RefUnwindSafe for WasmMemoryConfig
impl Send for WasmMemoryConfig
impl Sync for WasmMemoryConfig
impl Unpin for WasmMemoryConfig
impl UnwindSafe for WasmMemoryConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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