pub struct Field { /* private fields */ }Expand description
Single metadata field – name plus value.
Implementations§
Source§impl Field
impl Field
Sourcepub fn new(name: &'static str, value: FieldValue) -> Self
pub fn new(name: &'static str, value: FieldValue) -> Self
Create a new Field.
Sourcepub const fn value(&self) -> &FieldValue
pub const fn value(&self) -> &FieldValue
Field value.
Sourcepub const fn redaction(&self) -> FieldRedaction
pub const fn redaction(&self) -> FieldRedaction
Field redaction policy.
Sourcepub fn with_redaction(self, redaction: FieldRedaction) -> Self
pub fn with_redaction(self, redaction: FieldRedaction) -> Self
Override the redaction policy while consuming the field.
Sourcepub fn set_redaction(&mut self, redaction: FieldRedaction)
pub fn set_redaction(&mut self, redaction: FieldRedaction)
Update the redaction policy in place.
Sourcepub fn into_parts(self) -> (&'static str, FieldValue, FieldRedaction)
pub fn into_parts(self) -> (&'static str, FieldValue, FieldRedaction)
Consume the field and return owned components.
Sourcepub fn into_value(self) -> FieldValue
pub fn into_value(self) -> FieldValue
Consume the field and return only the value.
Trait Implementations§
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more