WithComments

Trait WithComments 

Source
pub trait WithComments: Sized {
    // Required methods
    fn comments(&self) -> &[String];
    fn add_comment<S>(&mut self, comment: S)
       where S: Into<String>;

    // Provided methods
    fn with_comment<S>(self, comment: S) -> Self
       where S: Into<String> { ... }
    fn write_comments(
        &self,
        comment_type: CommentType,
        b: &mut CodeBuffer,
        level: usize,
    ) { ... }
}
Expand description

An element with comment lines.

Required Methods§

Source

fn comments(&self) -> &[String]

Gets the comment lines.

Source

fn add_comment<S>(&mut self, comment: S)
where S: Into<String>,

Adds the comment line.

Provided Methods§

Source

fn with_comment<S>(self, comment: S) -> Self
where S: Into<String>,

Adds the comment line.

Source

fn write_comments( &self, comment_type: CommentType, b: &mut CodeBuffer, level: usize, )

Writes the comment lines.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§