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
impl RecordedComponentBoundary
pub fn new(application: ContextLabel, output: SourceOutput) -> Self
pub async fn start( &self, component: &dyn RecordedComponentLifecycle, ) -> Result<(), LifecycleSourceFailure>
pub async fn shutdown( &self, component: &dyn RecordedComponentLifecycle, primary: Option<DiagnosticOccurrence>, ) -> Result<(), LifecycleSourceFailure>
Sourcepub async fn start_with_timeout(
&self,
component: &dyn RecordedComponentLifecycle,
timeout: Duration,
) -> Result<(), LifecycleSourceFailure>
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.
pub async fn shutdown_with_timeout( &self, component: &dyn RecordedComponentLifecycle, primary: Option<DiagnosticOccurrence>, timeout: Duration, ) -> Result<(), LifecycleSourceFailure>
Auto Trait Implementations§
impl Freeze for RecordedComponentBoundary
impl RefUnwindSafe for RecordedComponentBoundary
impl Send for RecordedComponentBoundary
impl Sync for RecordedComponentBoundary
impl Unpin for RecordedComponentBoundary
impl UnsafeUnpin for RecordedComponentBoundary
impl UnwindSafe for RecordedComponentBoundary
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