pub struct ParsedValue<'a> {
pub value: Value<'a>,
pub raw: Option<Cow<'a, str>>,
pub source: Option<SourceSpan>,
pub expanded: Option<Cow<'a, str>>,
pub delimiter: Option<ValueDelimiter>,
}Expand description
Parsed BibTeX value plus optional source-preserving metadata.
Fields§
§value: Value<'a>Structured value.
raw: Option<Cow<'a, str>>Exact raw value text, when retained by the parser mode.
source: Option<SourceSpan>Source location for the value, when available.
expanded: Option<Cow<'a, str>>Expanded text projection, when a parser mode computes it separately.
delimiter: Option<ValueDelimiter>Original value delimiter or source shape, when retained.
Implementations§
Source§impl<'a> ParsedValue<'a>
impl<'a> ParsedValue<'a>
Sourcepub const fn new(value: Value<'a>) -> Self
pub const fn new(value: Value<'a>) -> Self
Create parsed-value metadata from a structured value.
Sourcepub fn into_value(self) -> Value<'a>
pub fn into_value(self) -> Value<'a>
Convert this parsed value into the structured value.
Sourcepub fn raw_text(&self) -> Option<&str>
pub fn raw_text(&self) -> Option<&str>
Return exact raw value text when raw preservation was requested.
Sourcepub fn expanded_text(&self) -> Option<&str>
pub fn expanded_text(&self) -> Option<&str>
Return requested expanded text when the parser populated it.
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
Return an ordinary text projection of the parsed value.
Sourcepub fn lossy_text(&self) -> String
pub fn lossy_text(&self) -> String
Return a display-oriented projection of the parsed value.
Sourcepub fn unicode_plain_text(&self) -> String
pub fn unicode_plain_text(&self) -> String
Return a Unicode-normalized plain-text projection.
Sourcepub fn into_owned(self) -> ParsedValue<'static>
pub fn into_owned(self) -> ParsedValue<'static>
Convert this parsed value into an owned value.
Trait Implementations§
Source§impl<'a> Clone for ParsedValue<'a>
impl<'a> Clone for ParsedValue<'a>
Source§fn clone(&self) -> ParsedValue<'a>
fn clone(&self) -> ParsedValue<'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 ParsedValue<'a>
impl<'a> Debug for ParsedValue<'a>
Source§impl<'a> PartialEq for ParsedValue<'a>
impl<'a> PartialEq for ParsedValue<'a>
Source§fn eq(&self, other: &ParsedValue<'a>) -> bool
fn eq(&self, other: &ParsedValue<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for ParsedValue<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedValue<'a>
impl<'a> RefUnwindSafe for ParsedValue<'a>
impl<'a> Send for ParsedValue<'a>
impl<'a> Sync for ParsedValue<'a>
impl<'a> Unpin for ParsedValue<'a>
impl<'a> UnsafeUnpin for ParsedValue<'a>
impl<'a> UnwindSafe for ParsedValue<'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