pub struct ParsedField<'a> {
pub name: Cow<'a, str>,
pub value: ParsedValue<'a>,
pub raw: Option<Cow<'a, str>>,
pub source: Option<SourceSpan>,
pub name_source: Option<SourceSpan>,
pub value_source: Option<SourceSpan>,
}Expand description
Parsed field plus optional source-preserving metadata.
Fields§
§name: Cow<'a, str>Field name as it appeared after parsing.
value: ParsedValue<'a>Parsed field value.
raw: Option<Cow<'a, str>>Exact raw field text, when retained by the parser mode.
source: Option<SourceSpan>Source location for the whole field, when available.
name_source: Option<SourceSpan>Source location for the field name, when available.
value_source: Option<SourceSpan>Source location for the field value, when available.
Implementations§
Source§impl<'a> ParsedField<'a>
impl<'a> ParsedField<'a>
Sourcepub fn from_field(field: Field<'a>) -> Self
pub fn from_field(field: Field<'a>) -> Self
Create parsed-field metadata from a structured field.
Sourcepub fn into_field(self) -> Field<'a>
pub fn into_field(self) -> Field<'a>
Convert this parsed field into the structured field.
Sourcepub fn into_owned(self) -> ParsedField<'static>
pub fn into_owned(self) -> ParsedField<'static>
Convert this parsed field into an owned value.
Trait Implementations§
Source§impl<'a> Clone for ParsedField<'a>
impl<'a> Clone for ParsedField<'a>
Source§fn clone(&self) -> ParsedField<'a>
fn clone(&self) -> ParsedField<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ParsedField<'a>
impl<'a> Debug for ParsedField<'a>
Source§impl<'a> PartialEq for ParsedField<'a>
impl<'a> PartialEq for ParsedField<'a>
Source§fn eq(&self, other: &ParsedField<'a>) -> bool
fn eq(&self, other: &ParsedField<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for ParsedField<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedField<'a>
impl<'a> RefUnwindSafe for ParsedField<'a>
impl<'a> Send for ParsedField<'a>
impl<'a> Sync for ParsedField<'a>
impl<'a> Unpin for ParsedField<'a>
impl<'a> UnsafeUnpin for ParsedField<'a>
impl<'a> UnwindSafe for ParsedField<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more