Skip to main content

PluginScope

Struct PluginScope 

Source
pub struct PluginScope { /* private fields */ }
Expand description

A hierarchical lifecycle coordinator that never carries media data.

Implementations§

Source§

impl PluginScope

Source

pub fn kind(&self) -> PluginScopeKind

Source

pub fn state(&self) -> PluginScopeState

Source

pub fn failure_reason(&self) -> Option<String>

Source

pub fn last_close_report(&self) -> Option<PluginScopeCloseReport>

Returns the most recent bounded terminal settlement aggregate.

Source

pub fn start(&self) -> Result<(), PluginScopeError>

Source

pub fn create_child( &self, kind: PluginScopeKind, ) -> Result<PluginScope, PluginScopeError>

Source

pub fn add_disposer<F>(&self, disposer: F) -> Result<(), PluginScopeError>
where F: FnOnce() + Send + 'static,

Source

pub fn add_owner_disposer<F>( &self, disposer: F, ) -> Result<PluginOwnerToken, PluginScopeError>
where F: FnOnce() + Send + 'static,

Registers one owner cleanup and returns its runtime-local quarantine token.

Source

pub fn add_fallible_owner_disposer<F>( &self, disposer: F, ) -> Result<PluginOwnerToken, PluginScopeError>
where F: FnOnce() -> Result<(), PluginOwnerDisposalError> + Send + 'static,

Registers one owner cleanup that can report a typed settlement failure.

Source

pub fn fail( &self, reason: impl Into<String>, ) -> Result<PluginScopeCloseReport, PluginScopeError>

Source

pub fn fail_with_timeout( &self, reason: impl Into<String>, timeout: Duration, ) -> Result<PluginScopeCloseReport, PluginScopeError>

Source

pub fn cancel(&self) -> Result<PluginScopeCloseReport, PluginScopeError>

Source

pub fn cancel_with_timeout( &self, timeout: Duration, ) -> Result<PluginScopeCloseReport, PluginScopeError>

Source

pub fn close(&self) -> Result<PluginScopeCloseReport, PluginScopeError>

Source

pub fn close_with_timeout( &self, timeout: Duration, ) -> Result<PluginScopeCloseReport, PluginScopeError>

Closes the scope with one total deadline shared by descendants and owners.

Remaining time is divided across pending cleanup so one stalled owner cannot consume every sibling’s budget. Concurrent draining work is isolated as Quarantined; close retains the retryable Busy behavior.

Trait Implementations§

Source§

impl Clone for PluginScope

Source§

fn clone(&self) -> PluginScope

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

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, 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> Same for T

Source§

type Output = T

Should always be Self
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.