Struct tracing_core::callsite::DefaultCallsite
source · pub struct DefaultCallsite {
interest: AtomicU8,
registration: AtomicU8,
meta: &'static Metadata<'static>,
next: AtomicPtr<Self>,
}
Expand description
A default Callsite
implementation.
Fields§
§interest: AtomicU8
§registration: AtomicU8
§meta: &'static Metadata<'static>
§next: AtomicPtr<Self>
Implementations§
source§impl DefaultCallsite
impl DefaultCallsite
const UNREGISTERED: u8 = 0u8
const REGISTERING: u8 = 1u8
const REGISTERED: u8 = 2u8
const INTEREST_NEVER: u8 = 0u8
const INTEREST_SOMETIMES: u8 = 1u8
const INTEREST_ALWAYS: u8 = 2u8
sourcepub const fn new(meta: &'static Metadata<'static>) -> Self
pub const fn new(meta: &'static Metadata<'static>) -> Self
Returns a new DefaultCallsite
with the specified Metadata
.
sourcepub fn register(&'static self) -> Interest
pub fn register(&'static self) -> Interest
Registers this callsite with the global callsite registry.
If the callsite is already registered, this does nothing. When using
DefaultCallsite
, this method should be preferred over
[tracing_core::callsite::register
], as it ensures that the callsite is
only registered a single time.
Other callsite implementations will generally ensure that callsites are not re-registered through another mechanism.
See the documentation on callsite registration for details on the global callsite registry.
Trait Implementations§
source§impl Callsite for DefaultCallsite
impl Callsite for DefaultCallsite
Auto Trait Implementations§
impl !Freeze for DefaultCallsite
impl !RefUnwindSafe for DefaultCallsite
impl Send for DefaultCallsite
impl Sync for DefaultCallsite
impl Unpin for DefaultCallsite
impl !UnwindSafe for DefaultCallsite
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