pub struct AmbientSlot(/* private fields */);Expand description
Implementations§
Source§impl AmbientSlot
impl AmbientSlot
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether the slot has been initialized with a runtime.
Sourcepub fn init<TEmitter, TFilter, TCtxt, TClock, TRng>(
&self,
pipeline: Runtime<TEmitter, TFilter, TCtxt, TClock, TRng>,
) -> Option<Runtime<&TEmitter, &TFilter, &TCtxt, &TClock, &TRng>>
pub fn init<TEmitter, TFilter, TCtxt, TClock, TRng>( &self, pipeline: Runtime<TEmitter, TFilter, TCtxt, TClock, TRng>, ) -> Option<Runtime<&TEmitter, &TFilter, &TCtxt, &TClock, &TRng>>
Try initialize the slot with the given components.
If the slot has not already been initialized then the components will be installed and a reference to the resulting Runtime will be returned. If the slot has already been initialized by another caller then this method will discard the components and return None.
Sourcepub fn get(&self) -> &AmbientRuntime<'_>
pub fn get(&self) -> &AmbientRuntime<'_>
Get the underlying Runtime, or a Runtime::default if it hasn’t been initialized yet.
Auto Trait Implementations§
impl !Freeze for AmbientSlot
impl !RefUnwindSafe for AmbientSlot
impl Send for AmbientSlot
impl Sync for AmbientSlot
impl Unpin for AmbientSlot
impl !UnwindSafe for AmbientSlot
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