Skip to main content

RecordedComponentBoundary

Struct RecordedComponentBoundary 

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

The mandatory-output consumer for a formal component. The Core lifecycle trait and its freely constructed SaddleError cannot enter this boundary.

ⓘ
use saddle_core::{ErrorKind, SaddleError};
use saddle_observability::root_diagnostic::LifecycleSourceFailure;
fn fake() -> LifecycleSourceFailure {
    SaddleError::new(ErrorKind::Internal, "fake", "no original").into()
}
ⓘ
use saddle_core::{ErrorKind, SaddleError};
use saddle_observability::root_diagnostic::LifecycleSourceFailure;
fn fake() -> LifecycleSourceFailure {
    let light = SaddleError::new(ErrorKind::Internal, "fake", "safe")
        .with_source_receipt(7_u8);
    light.into()
}
ⓘ
use saddle_observability::root_diagnostic::LifecycleSourceFailure;
fn forge() -> LifecycleSourceFailure { LifecycleSourceFailure(()) }
ⓘ
use saddle_runtime::RecordedComponentBoundary;
use saddle_core::ContextLabel;
fn missing_output(app: ContextLabel) -> RecordedComponentBoundary {
    RecordedComponentBoundary::new(app, None)
}

Implementations§

Source§

impl RecordedComponentBoundary

Source

pub fn new(application: ContextLabel, output: SourceOutput) -> Self

Source

pub async fn start( &self, component: &dyn RecordedComponentLifecycle, ) -> Result<(), LifecycleSourceFailure>

Source

pub async fn shutdown( &self, component: &dyn RecordedComponentLifecycle, primary: Option<DiagnosticOccurrence>, ) -> Result<(), LifecycleSourceFailure>

Source

pub async fn start_with_timeout( &self, component: &dyn RecordedComponentLifecycle, timeout: Duration, ) -> Result<(), LifecycleSourceFailure>

The task envelope preserves the sealed failure. Its own timeout has a distinct original, recorded before the cancelled task is reported.

Source

pub async fn shutdown_with_timeout( &self, component: &dyn RecordedComponentLifecycle, primary: Option<DiagnosticOccurrence>, timeout: Duration, ) -> Result<(), LifecycleSourceFailure>

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> 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, 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, !>

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.