Struct Interest

pub struct Interest(/* private field */);

Indicates a Subscriber's interest in a particular callsite.

Subscribers return an Interest from their register_callsite methods in order to determine whether that span should be enabled or disabled.

Implementations

impl Interest

fn never() -> Self

Returns an Interest indicating that the subscriber is never interested in being notified about a callsite.

If all active subscribers are never() interested in a callsite, it will be completely disabled unless a new subscriber becomes active.

fn sometimes() -> Self

Returns an Interest indicating the subscriber is sometimes interested in being notified about a callsite.

If all active subscribers are sometimes or never interested in a callsite, the currently active subscriber will be asked to filter that callsite every time it creates a span. This will be the case until a new subscriber expresses that it is always interested in the callsite.

fn always() -> Self

Returns an Interest indicating the subscriber is always interested in being notified about a callsite.

If any subscriber expresses that it is always() interested in a given callsite, then the callsite will always be enabled.

fn is_never(&self) -> bool

Returns true if the subscriber is never interested in being notified about this callsite.

fn is_sometimes(&self) -> bool

Returns true if the subscriber is sometimes interested in being notified about this callsite.

fn is_always(&self) -> bool

Returns true if the subscriber is always interested in being notified about this callsite.

Trait Implementations

impl Clone for Interest

fn clone(&self) -> Interest

impl Debug for Interest

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl Freeze for Interest

impl RefUnwindSafe for Interest

impl Send for Interest

impl Sync for Interest

impl Unpin for Interest

impl UnsafeUnpin for Interest

impl UnwindSafe for Interest

Blanket Implementations

impl<T> Any for Interest where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Interest where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Interest where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Interest where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Interest

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Interest where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for Interest where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Interest where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for Interest where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>