pub struct OperationScope { /* private fields */ }Expand description
RAII lifecycle helper. Dropping an unfinished scope emits Abandoned exactly once.
Implementations§
Source§impl OperationScope
impl OperationScope
pub fn start( observer: Arc<dyn RuntimeObserver>, parent_id: Option<OperationId>, context: ObservationContext, detail: OperationDetail, ) -> Self
pub fn id(&self) -> OperationId
Sourcepub fn attach_content(&mut self, content: ObservationContent)
pub fn attach_content(&mut self, content: ObservationContent)
Attach opt-in full input/output content carried into the finish
observation. Call before OperationScope::finish.
pub fn finish( self, outcome: OperationOutcome, error_category: Option<ErrorCategory>, measurements: RuntimeMeasurements, )
Trait Implementations§
Source§impl Drop for OperationScope
impl Drop for OperationScope
Auto Trait Implementations§
impl !RefUnwindSafe for OperationScope
impl !UnwindSafe for OperationScope
impl Freeze for OperationScope
impl Send for OperationScope
impl Sync for OperationScope
impl Unpin for OperationScope
impl UnsafeUnpin for OperationScope
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