Struct FieldSet

pub struct FieldSet { /* private fields */ }

Describes the fields present on a span.

Equality

In well-behaved applications, two FieldSets initialized with equal callsite identifiers will have identical fields. Consequently, in release builds, FieldSet::eq only checks that its arguments have equal callsites. However, the equality of field names is checked in debug builds.

Implementations

impl FieldSet

const fn new(names: &'static [&'static str], callsite: Identifier) -> Self

Constructs a new FieldSet with the given array of field names and callsite.

fn field<Q: Borrow<str> + ?Sized>(&self, name: &Q) -> Option<Field>

Returns the Field named name, or None if no such field exists.

fn contains(&self, field: &Field) -> bool

Returns true if self contains the given field.

Note: If field shares a name with a field
in this FieldSet, but was created by a FieldSet
with a different callsite, this FieldSet does not
contain it. This is so that if two separate span callsites define a field
named "foo", the Field corresponding to "foo" for each
of those callsites are not equivalent.
fn iter(&self) -> Iter

Returns an iterator over the Fields in this FieldSet.

fn len(&self) -> usize

Returns the number of fields in this FieldSet.

fn is_empty(&self) -> bool

Returns whether or not this FieldSet has fields.

Trait Implementations

impl Debug for FieldSet

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

impl Display for FieldSet

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

impl Eq for FieldSet

impl PartialEq for FieldSet

fn eq(&self, other: &Self) -> bool

Auto Trait Implementations

impl !RefUnwindSafe for FieldSet

impl !UnwindSafe for FieldSet

impl Freeze for FieldSet

impl Send for FieldSet

impl Sync for FieldSet

impl Unpin for FieldSet

impl UnsafeUnpin for FieldSet

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for FieldSet

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for FieldSet where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for FieldSet 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 FieldSet 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 FieldSet where U: TryFrom<T>,

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