pub struct ParsedComment<'a> {
pub text: Cow<'a, str>,
pub source: Option<SourceSpan>,
pub raw: Option<Cow<'a, str>>,
}Expand description
Parsed comment plus optional source-preserving metadata.
Fields§
§text: Cow<'a, str>Comment text.
source: Option<SourceSpan>Source location for the comment, when available.
raw: Option<Cow<'a, str>>Exact raw comment text, when retained by the parser mode.
Implementations§
Source§impl<'a> ParsedComment<'a>
impl<'a> ParsedComment<'a>
Sourcepub fn from_comment(comment: Comment<'a>) -> Self
pub fn from_comment(comment: Comment<'a>) -> Self
Create parsed-comment metadata from a structured comment.
Sourcepub fn into_owned(self) -> ParsedComment<'static>
pub fn into_owned(self) -> ParsedComment<'static>
Convert this parsed comment into an owned value.
Trait Implementations§
Source§impl<'a> Clone for ParsedComment<'a>
impl<'a> Clone for ParsedComment<'a>
Source§fn clone(&self) -> ParsedComment<'a>
fn clone(&self) -> ParsedComment<'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 ParsedComment<'a>
impl<'a> Debug for ParsedComment<'a>
Source§impl<'a> PartialEq for ParsedComment<'a>
impl<'a> PartialEq for ParsedComment<'a>
Source§fn eq(&self, other: &ParsedComment<'a>) -> bool
fn eq(&self, other: &ParsedComment<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> Eq for ParsedComment<'a>
impl<'a> StructuralPartialEq for ParsedComment<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedComment<'a>
impl<'a> RefUnwindSafe for ParsedComment<'a>
impl<'a> Send for ParsedComment<'a>
impl<'a> Sync for ParsedComment<'a>
impl<'a> Unpin for ParsedComment<'a>
impl<'a> UnsafeUnpin for ParsedComment<'a>
impl<'a> UnwindSafe for ParsedComment<'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