pub struct ComponentRegistryHandle { /* private fields */ }Expand description
A cloneable, read-only handle to a component registry.
This handle provides access to read-only operations such as creating an API handler or verifying bounds. Unlike
ComponentRegistry, it can be freely cloned and shared across ownership boundaries.
Obtained via ComponentRegistry::root.
Implementations§
Source§impl ComponentRegistryHandle
impl ComponentRegistryHandle
Sourcepub fn verify_bounds(
&self,
initial_grant: MemoryGrant,
) -> Result<VerifiedBounds, VerifierError>
pub fn verify_bounds( &self, initial_grant: MemoryGrant, ) -> Result<VerifiedBounds, VerifierError>
Validates that all components are able to respect the calculated effective limit.
If validation succeeds, VerifiedBounds 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 (for example, minimum required bytes higher than firm limit)
- when the combined total of the firm limit for all components exceeds the effective limit
Sourcepub fn api_handler(&self) -> MemoryAPIHandler
pub fn api_handler(&self) -> MemoryAPIHandler
Gets an API handler for reporting the memory bounds and usage of all component in the registry.
This handler exposes routes for querying the memory bounds and usage of all registered components. See
MemoryAPIHandler for more information about routes and responses.
Sourcepub fn as_bounds(&self) -> ComponentBounds
pub fn as_bounds(&self) -> ComponentBounds
Gets the total minimum required bytes for all components in the registry.
See ComponentRegistry::as_bounds for more details.
Trait Implementations§
Source§impl Clone for ComponentRegistryHandle
impl Clone for ComponentRegistryHandle
Source§fn clone(&self) -> ComponentRegistryHandle
fn clone(&self) -> ComponentRegistryHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ComponentRegistryHandle
impl RefUnwindSafe for ComponentRegistryHandle
impl Send for ComponentRegistryHandle
impl Sync for ComponentRegistryHandle
impl Unpin for ComponentRegistryHandle
impl UnsafeUnpin for ComponentRegistryHandle
impl UnwindSafe for ComponentRegistryHandle
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§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