pub enum UsageExpr {
Config {
name: String,
value: usize,
},
StructSize {
name: String,
value: usize,
},
Constant {
name: String,
value: usize,
},
Product {
values: Vec<UsageExpr>,
},
Sum {
values: Vec<UsageExpr>,
},
}Expand description
Represents a memory usage expression for a component.
Variants§
Config
A config value
StructSize
A struct size
Constant
A constant value
Product
A product of subexpressions
Sum
A sum of subexpressions
Implementations§
Source§impl UsageExpr
impl UsageExpr
Sourcepub fn config(s: impl Into<String>, value: usize) -> Self
pub fn config(s: impl Into<String>, value: usize) -> Self
Creates a new usage expression that is a config value.
Sourcepub fn constant(s: impl Into<String>, value: usize) -> Self
pub fn constant(s: impl Into<String>, value: usize) -> Self
Creates a new usage expression that is a constant value.
Sourcepub fn struct_size<T>(s: impl Into<String>) -> Self
pub fn struct_size<T>(s: impl Into<String>) -> Self
Creates a new usage expression that is a struct size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsageExpr
impl RefUnwindSafe for UsageExpr
impl Send for UsageExpr
impl Sync for UsageExpr
impl Unpin for UsageExpr
impl UnwindSafe for UsageExpr
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self> ⓘ
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self> ⓘ
Instruments this type by attaching the given allocation group token, returning a
Tracked wrapper. Read more