pub struct BoundsVerifier { /* private fields */ }Expand description
Memory bounds verifier.
Implementations§
Source§impl BoundsVerifier
impl BoundsVerifier
Sourcepub fn new(grant: MemoryGrant, component_bounds: ComponentBounds) -> Self
pub fn new(grant: MemoryGrant, component_bounds: ComponentBounds) -> Self
Creates a new memory bounds verifier with the given memory grant and components bounds.
Sourcepub fn verify(self) -> Result<VerifiedBounds, VerifierError>
pub fn verify(self) -> Result<VerifiedBounds, VerifierError>
Validates that all components are able to respect the calculated effective limit.
If validation succeeds, a MemoryGrant is returned which provides information about the effective limit that
can be used for allocating memory.
§Errors
A number of invalid conditions are checked and will cause an error to be returned:
- when a component has invalid bounds (e.g. minimum required bytes higher than firm limit)
- when the combined total of the firm limit for all components exceeds the effective limit
Auto Trait Implementations§
impl Freeze for BoundsVerifier
impl RefUnwindSafe for BoundsVerifier
impl Send for BoundsVerifier
impl Sync for BoundsVerifier
impl Unpin for BoundsVerifier
impl UnwindSafe for BoundsVerifier
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> 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