pub struct Comment { /* private fields */ }Expand description
Structure for containing the CommentKind and the Span for a comment
Implementations§
Source§impl Comment
impl Comment
Sourcepub const fn new(kind: CommentKind, span: Span) -> Self
pub const fn new(kind: CommentKind, span: Span) -> Self
Method for making a new comment
§Parameters
kindwhere the type of comment is passed as aCommentKindspanwhere theSpanof the comment is passed
Sourcepub const fn kind(&self) -> &CommentKind
pub const fn kind(&self) -> &CommentKind
Getter method to get the CommentKind
Sourcepub fn text(&self) -> &str
pub fn text(&self) -> &str
Getter method that will return the comment content as a str,
regardless of CommentKind
Trait Implementations§
impl Eq for Comment
impl StructuralPartialEq for Comment
Auto Trait Implementations§
impl Freeze for Comment
impl RefUnwindSafe for Comment
impl Send for Comment
impl Sync for Comment
impl Unpin for Comment
impl UnwindSafe for Comment
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