1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
//! Module of Comment structure. /// A structure that represents a comment tag. /// grammar: `<!-- comment -->` #[derive(Debug, Clone)] pub struct Comment { comment: String, } impl Comment { /// Create new Comment structure. /// /// # Arguments /// * `comment` - If `<!-- hello -->`, then `hello`. pub fn new(comment: String) -> Comment { Comment { comment } } /// Returns the comment. /// If `<!-- hello -->`, then returns `hello`. pub fn get_comment(&self) -> &str { &self.comment } }