pub struct MemoryRequirements {
pub base_memory: usize,
pub model_memory: usize,
pub cache_overhead: usize,
pub preload_overhead: usize,
pub worker_overhead: usize,
pub total: usize,
}
Expand description
Memory requirements calculation result
Fields§
§base_memory: usize
Base WebAssembly memory
model_memory: usize
Memory for model data
cache_overhead: usize
Cache overhead
preload_overhead: usize
Preloading overhead
worker_overhead: usize
Worker overhead
total: usize
Total memory requirement
Implementations§
Source§impl MemoryRequirements
impl MemoryRequirements
Sourcepub fn breakdown_percentages(&self) -> MemoryBreakdown
pub fn breakdown_percentages(&self) -> MemoryBreakdown
Get memory usage breakdown as percentages
Sourcepub fn format_size(bytes: usize) -> String
pub fn format_size(bytes: usize) -> String
Format memory size as human-readable string
Sourcepub fn total_formatted(&self) -> String
pub fn total_formatted(&self) -> String
Get formatted total memory requirement
Trait Implementations§
Source§impl Clone for MemoryRequirements
impl Clone for MemoryRequirements
Source§fn clone(&self) -> MemoryRequirements
fn clone(&self) -> MemoryRequirements
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 moreAuto Trait Implementations§
impl Freeze for MemoryRequirements
impl RefUnwindSafe for MemoryRequirements
impl Send for MemoryRequirements
impl Sync for MemoryRequirements
impl Unpin for MemoryRequirements
impl UnwindSafe for MemoryRequirements
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