pub struct DocComment {
pub text: String,
pub is_module_doc: bool,
pub span: ByteRange,
}Expand description
A documentation comment attached to a declaration.
Fields§
§text: StringThe raw comment text (without the /-- delimiters).
is_module_doc: boolWhether this is a module-level doc comment.
span: ByteRangeByte range of the comment in the source.
Implementations§
Source§impl DocComment
impl DocComment
Sourcepub fn module_doc(text: &str) -> Self
pub fn module_doc(text: &str) -> Self
Create a module-level doc comment.
Sourcepub fn first_line(&self) -> &str
pub fn first_line(&self) -> &str
The first line of the doc comment (for summaries).
Trait Implementations§
Source§impl Clone for DocComment
impl Clone for DocComment
Source§fn clone(&self) -> DocComment
fn clone(&self) -> DocComment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocComment
impl Debug for DocComment
Source§impl Display for DocComment
impl Display for DocComment
Source§impl PartialEq for DocComment
impl PartialEq for DocComment
impl Eq for DocComment
impl StructuralPartialEq for DocComment
Auto Trait Implementations§
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