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) -> SelfConstructs a new
FieldSetwith the given array of field names and callsite.fn field<Q: Borrow<str> + ?Sized>(&self, name: &Q) -> Option<Field>Returns the
Fieldnamedname, orNoneif no such field exists.fn contains(&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) -> IterReturns an iterator over the
Fields in thisFieldSet.fn len(&self) -> usizeReturns the number of fields in this
FieldSet.fn is_empty(&self) -> boolReturns whether or not this
FieldSethas 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) -> TReturns 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) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses 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>