pub struct Comment<'a> {
pub type: CommentType,
pub source: Cow<'a, str>,
pub text: Cow<'a, str>,
}Expand description
A parsed comment with both raw source and trimmed text.
Fields§
§type: CommentType§source: Cow<'a, str>§text: Cow<'a, str>Implementations§
Source§impl Comment<'_>
impl Comment<'_>
Sourcepub fn into_owned(self) -> Comment<'static>
pub fn into_owned(self) -> Comment<'static>
Copy the structure and clone the original values if it’s not owned.
This is always a deep copy of the structure.
Source§impl<'a> Comment<'a>
impl<'a> Comment<'a>
pub fn new(type: CommentType, source: &'a str, text: &'a str) -> Self
pub fn single_line(source: &'a str) -> Self
pub fn multi_line(source: &'a str) -> Self
Trait Implementations§
Source§impl<'a> From<Comment<'a>> for ExtendEntry<'a>
impl<'a> From<Comment<'a>> for ExtendEntry<'a>
Source§impl<'a> From<Comment<'a>> for MessageEntry<'a>
impl<'a> From<Comment<'a>> for MessageEntry<'a>
Source§impl<'a> From<Comment<'a>> for OneOfEntry<'a>
impl<'a> From<Comment<'a>> for OneOfEntry<'a>
Source§impl<'a> From<Comment<'a>> for ServiceEntry<'a>
impl<'a> From<Comment<'a>> for ServiceEntry<'a>
impl<'a> StructuralPartialEq for Comment<'a>
Auto Trait Implementations§
impl<'a> Freeze for Comment<'a>
impl<'a> RefUnwindSafe for Comment<'a>
impl<'a> Send for Comment<'a>
impl<'a> Sync for Comment<'a>
impl<'a> Unpin for Comment<'a>
impl<'a> UnwindSafe for Comment<'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