Struct FieldSet

struct FieldSet { ... }

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: &Self, name: &Q) -> Option<Field>

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

fn contains(self: &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: &Self) -> Iter

Returns an iterator over the Fields in this FieldSet.

fn len(self: &Self) -> usize

Returns the number of fields in this FieldSet.

fn is_empty(self: &Self) -> bool

Returns whether or not this FieldSet has fields.

impl Debug for FieldSet

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

impl Display for FieldSet

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

impl Eq for FieldSet

impl Freeze for FieldSet

impl PartialEq for FieldSet

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

impl RefUnwindSafe for FieldSet

impl Send for FieldSet

impl Sync for FieldSet

impl Unpin for FieldSet

impl UnsafeUnpin for FieldSet

impl UnwindSafe for FieldSet

impl<T> Any for FieldSet

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for FieldSet

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for FieldSet

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

impl<T> From for FieldSet

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToString for FieldSet

fn to_string(self: &Self) -> String

impl<T, U> Into for FieldSet

fn into(self: 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 for FieldSet

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

impl<T, U> TryInto for FieldSet

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