pub struct AmbientSlot(/* private fields */);Expand description
Implementations§
Source§impl AmbientSlot
impl AmbientSlot
Sourcepub const fn new() -> AmbientSlot
pub const fn new() -> AmbientSlot
Create a new, empty slot.
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,
) -> &Runtime<&(dyn ErasedEmitter + Sync + Send + 'static), &(dyn ErasedFilter + Sync + Send + 'static), &(dyn ErasedCtxt + Sync + Send + 'static), &(dyn ErasedClock + Sync + Send + 'static), &(dyn ErasedRng + Sync + Send + 'static)>
pub fn get( &self, ) -> &Runtime<&(dyn ErasedEmitter + Sync + Send + 'static), &(dyn ErasedFilter + Sync + Send + 'static), &(dyn ErasedCtxt + Sync + Send + 'static), &(dyn ErasedClock + Sync + Send + 'static), &(dyn ErasedRng + Sync + Send + 'static)>
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 !UnwindSafe for AmbientSlot
impl Forget for AmbientSlot
impl Move for AmbientSlot
impl Send for AmbientSlot
impl Sync for AmbientSlot
impl Unpin for AmbientSlotwhere
Align4<u32>: Unpin,
Box<dyn AnyEmitter + Sync + Send>: Unpin,
Box<dyn AnyFilter + Sync + Send>: Unpin,
Box<dyn AnyCtxt + Sync + Send>: Unpin,
Box<dyn AnyClock + Sync + Send>: Unpin,
Box<dyn AnyRng + Sync + Send>: Unpin,
*const dyn ErasedEmitter + Sync + Send: Unpin,
*const dyn ErasedFilter + Sync + Send: Unpin,
*const dyn ErasedCtxt + Sync + Send: Unpin,
*const dyn ErasedClock + Sync + Send: Unpin,
*const dyn ErasedRng + Sync + Send: Unpin,
impl UnsafeUnpin for AmbientSlotwhere
Align4<u32>: UnsafeUnpin,
*const dyn AnyEmitter + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn AnyEmitter + Sync + Send>: UnsafeUnpin,
*const dyn AnyFilter + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn AnyFilter + Sync + Send>: UnsafeUnpin,
*const dyn AnyCtxt + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn AnyCtxt + Sync + Send>: UnsafeUnpin,
*const dyn AnyClock + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn AnyClock + Sync + Send>: UnsafeUnpin,
*const dyn AnyRng + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn AnyRng + Sync + Send>: UnsafeUnpin,
*const dyn ErasedEmitter + Sync + Send: UnsafeUnpin,
*const dyn ErasedFilter + Sync + Send: UnsafeUnpin,
*const dyn ErasedCtxt + Sync + Send: UnsafeUnpin,
*const dyn ErasedClock + Sync + Send: UnsafeUnpin,
*const dyn ErasedRng + Sync + Send: UnsafeUnpin,
PhantomData<AmbientSync>: UnsafeUnpin,
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