Skip to main content

OwnershipSnapshot

Struct OwnershipSnapshot 

Source
#[non_exhaustive]
pub struct OwnershipSnapshot { pub configured_limit: Option<usize>, pub effective_limit: Option<usize>, pub available: Option<usize>, pub waiters: usize, pub admission_open: bool, pub cleanup_queued: usize, pub cleanup_running: usize, }
Expand description

Point-in-time ownership-admission and deferred-cleanup state.

Finite capacity is shared by accepted tasks and configured subscribers. A unit remains in use until its final user-owned values finish isolated destruction. Destructor failure can permanently reduce the effective limit.

The three limit fields are None when ownership admission is configured as unlimited. Cleanup counts remain available in that mode.

Configured, effective, available, and waiter values are copied under one broker lock. admission_open also combines a separate runtime-lifecycle read, and cleanup values are copied under the worker lock. A concurrent transition can therefore appear in only one part of this rolling snapshot. The complete value can also become stale immediately after it is returned.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§configured_limit: Option<usize>

Original finite ownership limit, or None for unlimited admission.

§effective_limit: Option<usize>

Usable finite limit after permanent retirement, or None for unlimited admission.

§available: Option<usize>

Finite units not held by permits or grants, or None for unlimited admission.

§waiters: usize

Requests currently parked in finite-capacity admission.

A complete grant that has not yet been observed is already counted as in use, not as a waiter.

§admission_open: bool

Whether the runtime and ownership broker still accept new requests.

An open snapshot may have no currently available units.

§cleanup_queued: usize

Deferred-cleanup batches waiting for a destructor-isolation worker.

§cleanup_running: usize

Deferred-cleanup batches claimed by workers and not yet completed.

Implementations§

Source§

impl OwnershipSnapshot

Source

pub fn retired(&self) -> Option<usize>

Units permanently removed from a finite configured limit.

Unlimited admission produces None.

Source

pub fn in_use(&self) -> Option<usize>

Finite units currently held by permits or unobserved grants.

This includes accepted task and subscriber ownership as well as queued or running deferred cleanup. Unlimited admission produces None.

Trait Implementations§

Source§

impl Clone for OwnershipSnapshot

Source§

fn clone(&self) -> OwnershipSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OwnershipSnapshot

Source§

impl Debug for OwnershipSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OwnershipSnapshot

Source§

impl PartialEq for OwnershipSnapshot

Source§

fn eq(&self, other: &OwnershipSnapshot) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OwnershipSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more