pub struct DiagnosticSupport<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> { /* private fields */ }Expand description
Shared state for optional diagnostic logging plus optional telemetry hooks.
This is the reusable control-flow skeleton shared by diagnostic-enabled widgets and screens:
- optional bounded log
- optional hook collection
- shared
record()ordering: hooks first, then log
Implementations§
Source§impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> DiagnosticSupport<E, H>
impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> DiagnosticSupport<E, H>
Sourcepub fn with_log(self, log: DiagnosticLog<E>) -> Self
pub fn with_log(self, log: DiagnosticLog<E>) -> Self
Enable logging with the provided diagnostic log.
Sourcepub fn with_hooks(self, hooks: H) -> Self
pub fn with_hooks(self, hooks: H) -> Self
Enable telemetry hooks with the provided hook set.
Sourcepub fn set_log(&mut self, log: DiagnosticLog<E>)
pub fn set_log(&mut self, log: DiagnosticLog<E>)
Replace the diagnostic log.
Sourcepub fn log(&self) -> Option<&DiagnosticLog<E>>
pub fn log(&self) -> Option<&DiagnosticLog<E>>
Borrow the diagnostic log, if enabled.
Sourcepub fn log_mut(&mut self) -> Option<&mut DiagnosticLog<E>>
pub fn log_mut(&mut self) -> Option<&mut DiagnosticLog<E>>
Mutably borrow the diagnostic log, if enabled.
Trait Implementations§
Source§impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> Debug for DiagnosticSupport<E, H>
impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> Debug for DiagnosticSupport<E, H>
Source§impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> Default for DiagnosticSupport<E, H>
impl<E: DiagnosticRecord, H: DiagnosticHookDispatch<E>> Default for DiagnosticSupport<E, H>
Auto Trait Implementations§
impl<E, H> Freeze for DiagnosticSupport<E, H>where
H: Freeze,
impl<E, H> RefUnwindSafe for DiagnosticSupport<E, H>where
H: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, H> Send for DiagnosticSupport<E, H>
impl<E, H> Sync for DiagnosticSupport<E, H>
impl<E, H> Unpin for DiagnosticSupport<E, H>
impl<E, H> UnsafeUnpin for DiagnosticSupport<E, H>where
H: UnsafeUnpin,
impl<E, H> UnwindSafe for DiagnosticSupport<E, H>where
H: UnwindSafe,
E: UnwindSafe,
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