pub struct DocComment {
pub matching_source: Fragment,
pub text: String,
}Available on crate feature
ast-models only.Expand description
A doc comment (///, //!, /** */, or /*! */) attached to an item or source file.
Fields§
§matching_source: FragmentThe full source of the comment, including the comment markers.
text: StringThe text of the comment, without the comment markers (///, /**, */, etc.).
Implementations§
Source§impl DocComment
impl DocComment
Sourcepub fn from_fragment(matching_source: Fragment) -> Self
pub fn from_fragment(matching_source: Fragment) -> Self
Construct a DocComment from the Fragment of a doc comment token, stripping the comment markers.
Trait Implementations§
Source§impl AstNode for DocComment
impl AstNode for DocComment
Source§fn matching_source(&self) -> &Fragment
fn matching_source(&self) -> &Fragment
Get the Fragment of source code this node was parsed from.
Source§impl Clone for DocComment
impl Clone for DocComment
Source§impl Debug for DocComment
impl Debug for DocComment
Source§impl PartialEq for DocComment
impl PartialEq for DocComment
impl StructuralPartialEq for DocComment
Auto Trait Implementations§
impl Forget for DocComment
impl Freeze for DocComment
impl RefUnwindSafe for DocComment
impl Send for DocComment
impl Sync for DocComment
impl Unpin for DocComment
impl UnsafeUnpin for DocComment
impl UnwindSafe for DocComment
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