# tracing_core::field::FieldSet - Rust
API documentation for the Rust `FieldSet` struct in crate `tracing_core`.
Keywords: rust, rustlang, rust-lang, FieldSet

# Struct tracing_core::field::FieldSet [−] [src]

    pub struct FieldSet { /* fields omitted */ }

Describes the fields present on a span.

## Implementations

### `impl FieldSet` [src]

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

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

#### `pub fn field<Q: ?Sized>(&self, name: &Q) -> Option<Field> where
Q: Borrow<str>,` [src]

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

#### `pub fn contains(&self, field: &Field) -> bool` [src]

Returns `true` if `self` contains the given `field`.

ⓘNote

    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.

#### `pub fn iter(&self) -> Iterⓘ

### Notable traits for Iter

`impl Iterator for Iter type Item = Field;`
` [src]

Returns an iterator over the `Field`s in this `FieldSet`.

#### `pub fn len(&self) -> usize` [src]

Returns the number of fields in this `FieldSet`.

#### `pub fn is_empty(&self) -> bool` [src]

Returns whether or not this `FieldSet` has fields.

## Trait Implementations

### `impl Debug for FieldSet` [src]

#### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` [src]

Formats the value using the given formatter. Read more

### `impl Display for FieldSet` [src]

#### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` [src]

Formats the value using the given formatter. Read more

### `impl<'a> IntoIterator for &'a FieldSet` [src]

#### `type IntoIter = Iter`

Which kind of iterator are we turning this into?

#### `type Item = Field`

The type of the elements being iterated over.

#### `fn into_iter(self) -> Self::IntoIter` [src]

Creates an iterator from a value. Read more

## Auto Trait Implementations

### `impl !RefUnwindSafe for FieldSet` [src]

### `impl Send for FieldSet` [src]

### `impl Sync for FieldSet` [src]

### `impl Unpin for FieldSet` [src]

### `impl !UnwindSafe for FieldSet` [src]

## Blanket Implementations

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `pub fn type_id(&self) -> TypeId` [src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow(&self) -> &T` [src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow_mut(&mut self) -> &mut T` [src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T` [src]

#### `pub fn from(t: T) -> T` [src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `pub fn into(self) -> U` [src]

Performs the conversion.

### `impl<T> ToString for T where
T: Display + ?Sized,` [src]

#### `pub default fn to_string(&self) -> String` [src]

Converts the given value to a `String`. Read more

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>` [src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>` [src]

Performs the conversion.