pub struct MemoryBoundsBuilder<'a> { /* private fields */ }
Expand description
Builder for defining the memory bounds of a component and its subcomponents.
This builder provides a simple interface for defining the minimum and firm bounds of a component, as well as declaring subcomponents. For example, a topology can contain its own “self” memory bounds, and then define the individual bounds for each component in the topology.
Implementations§
Source§impl MemoryBoundsBuilder<'_>
impl MemoryBoundsBuilder<'_>
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the bounds of the current component to a default state.
This can be used in scenarios where the bounds of a component need to be redefined after they have been specified, as not all components are able to be defined in a single pass.
Sourcepub fn minimum(&mut self) -> BoundsBuilder<'_, Minimum>
pub fn minimum(&mut self) -> BoundsBuilder<'_, Minimum>
Gets a builder object for defining the minimum bounds of the current component.
Sourcepub fn firm(&mut self) -> BoundsBuilder<'_, Firm>
pub fn firm(&mut self) -> BoundsBuilder<'_, Firm>
Gets a builder object for defining the firm bounds of the current component.
The firm limit is additive with the minimum required memory, so entries that are added via minimum
do not need
to be added again here.
Sourcepub fn subcomponent<S>(&mut self, name: S) -> MemoryBoundsBuilder<'_>
pub fn subcomponent<S>(&mut self, name: S) -> MemoryBoundsBuilder<'_>
Creates a nested subcomponent and gets a builder object for it.
This allows for defining the bounds of various subcomponents within a larger component, which are then rolled up into the calculated bounds for the parent component.
Sourcepub fn with_subcomponent<S, C>(&mut self, name: S, component: &C) -> &mut Self
pub fn with_subcomponent<S, C>(&mut self, name: S, component: &C) -> &mut Self
Creates a nested subcomponent based on the given component.
This allows for defining a subcomponent whose bounds come from an object that implements MemoryBounds
directly.
Auto Trait Implementations§
impl<'a> Freeze for MemoryBoundsBuilder<'a>
impl<'a> RefUnwindSafe for MemoryBoundsBuilder<'a>
impl<'a> Send for MemoryBoundsBuilder<'a>
impl<'a> Sync for MemoryBoundsBuilder<'a>
impl<'a> Unpin for MemoryBoundsBuilder<'a>
impl<'a> UnwindSafe for MemoryBoundsBuilder<'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> 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> ⓘ
Tracked
wrapper. Read more