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) -> SelfConstructs a new
FieldSetwith the given array of field names and callsite.fn field<Q: Borrow<str> + ?Sized>(self: &Self, name: &Q) -> Option<Field>Returns the
Fieldnamedname, orNoneif no such field exists.fn contains(self: &Self, field: &Field) -> boolReturns
trueifselfcontains the givenfield.Note: If
fieldshares a name with a field in thisFieldSet, but was created by aFieldSetwith a different callsite, thisFieldSetdoes not contain it. This is so that if two separate span callsites define a field named "foo", theFieldcorresponding to "foo" for each of those callsites are not equivalent.fn iter(self: &Self) -> IterReturns an iterator over the
Fields in thisFieldSet.fn len(self: &Self) -> usizeReturns the number of fields in this
FieldSet.fn is_empty(self: &Self) -> boolReturns whether or not this
FieldSethas 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) -> TReturns the argument unchanged.
impl<T> ToString for FieldSet
fn to_string(self: &Self) -> String
impl<T, U> Into for FieldSet
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses 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>