pub struct BlockComment { /* private fields */ }
Expand description
Lines that are representation as block comment. (like "/' begin \n end '/\n"
.)
- “ /’ begin \n end ’/\n“
§Examples
use plantuml_parser::{BlockComment, ParseContainer};
let input = r#" /' begin comment
in comment
end comment '/
outer"#;
let (rest, (parsed, comment)) = BlockComment::parse(input.into())?;
assert_eq!(rest, "outer");
assert_eq!(parsed, r#" /' begin comment
in comment
end comment '/
"#);
assert!(comment.is_completed());
let input = " /' not ending comment \n";
let (rest, (parsed, comment)) = BlockComment::parse(input.into())?;
assert_eq!(rest, "");
assert_eq!(parsed, " /' not ending comment \n");
assert!(!comment.is_completed());
Implementations§
Source§impl BlockComment
impl BlockComment
Sourcepub fn parse(input: ParseContainer) -> ParseResult<Self>
pub fn parse(input: ParseContainer) -> ParseResult<Self>
Tries to parse BlockComment
. (e.g. "/' begin \n end '/\n"
.)
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Returns whether the BlockCommentCloseLine
was found.
Sourcepub fn lines(&self) -> &[Arc<PlantUmlLine>]
pub fn lines(&self) -> &[Arc<PlantUmlLine>]
Returns the reference of the list of lines in this block.
Trait Implementations§
Source§impl Clone for BlockComment
impl Clone for BlockComment
Source§fn clone(&self) -> BlockComment
fn clone(&self) -> BlockComment
Returns a copy 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 BlockComment
impl Debug for BlockComment
Auto Trait Implementations§
impl Freeze for BlockComment
impl RefUnwindSafe for BlockComment
impl Send for BlockComment
impl Sync for BlockComment
impl Unpin for BlockComment
impl UnwindSafe for BlockComment
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