pub struct ParsedSource<'a> {
pub id: SourceId,
pub name: Option<Cow<'a, str>>,
}Expand description
Source metadata associated with a parsed document.
Fields§
§id: SourceIdSource index inside the document.
name: Option<Cow<'a, str>>Human-readable source name or path, when known.
Implementations§
Source§impl ParsedSource<'_>
impl ParsedSource<'_>
Sourcepub const fn is_anonymous(&self) -> bool
pub const fn is_anonymous(&self) -> bool
Return true when this source has no caller-provided name.
Sourcepub fn into_owned(self) -> ParsedSource<'static>
pub fn into_owned(self) -> ParsedSource<'static>
Convert this source metadata into an owned value.
Trait Implementations§
Source§impl<'a> Clone for ParsedSource<'a>
impl<'a> Clone for ParsedSource<'a>
Source§fn clone(&self) -> ParsedSource<'a>
fn clone(&self) -> ParsedSource<'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 ParsedSource<'a>
impl<'a> Debug for ParsedSource<'a>
Source§impl<'a> PartialEq for ParsedSource<'a>
impl<'a> PartialEq for ParsedSource<'a>
Source§fn eq(&self, other: &ParsedSource<'a>) -> bool
fn eq(&self, other: &ParsedSource<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Eq for ParsedSource<'a>
impl<'a> StructuralPartialEq for ParsedSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedSource<'a>
impl<'a> RefUnwindSafe for ParsedSource<'a>
impl<'a> Send for ParsedSource<'a>
impl<'a> Sync for ParsedSource<'a>
impl<'a> Unpin for ParsedSource<'a>
impl<'a> UnsafeUnpin for ParsedSource<'a>
impl<'a> UnwindSafe for ParsedSource<'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