pub struct Comment { /* private fields */ }Expand description
Representation of a comment message intended only for human consumption. Includes basic formatting information.
Implementations
sourceimpl Comment
impl Comment
sourcepub fn link<S: ToString>(self, text: S, path: PathBuf) -> Self
pub fn link<S: ToString>(self, text: S, path: PathBuf) -> Self
Adds a piece of text to the comment that links to the given path.
sourcepub fn url<S: ToString, U: ToString>(self, text: S, url: U) -> Self
pub fn url<S: ToString, U: ToString>(self, text: S, url: U) -> Self
Adds a piece of text to the comment that links to the given URL.
sourcepub fn extend(&mut self, other: Comment)
pub fn extend(&mut self, other: Comment)
Pushes a whole other comment’s worth of elements into this comment.
sourcepub fn elements(&self) -> &[Element]
pub fn elements(&self) -> &[Element]
Returns the slice of elements that comprise the comment.
This list is “minimal:”
- there are no consecutive newlines, list item tags, or spans with equal formatting (they are merged together);
- there are no empty lists, and there is never a list item immediately following a list open tag (as this is redundant).
Trait Implementations
impl StructuralPartialEq for Comment
Auto Trait Implementations
impl RefUnwindSafe for Comment
impl Send for Comment
impl Sync for Comment
impl Unpin for Comment
impl UnwindSafe for Comment
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more