[−][src]Enum comment_parser::Event
Text is the contents of the comment, while raw includes additional characters based on the type of comment, such as the comment delimiters or "start and end symbols" of the comment.
LineComment
'sraw
includes the whole line.BlockComment
'sraw
includes only the block comment delimiters.
The above is only true, for events parsed by CommentParser
.
Example
let line = Event::LineComment(" // Foo Bar", " Foo Bar"); assert_eq!(line.text(), " Foo Bar"); assert_eq!(line.raw(), " // Foo Bar"); let block = Event::BlockComment("/* Foo\n Bar */", " Foo\n Bar "); assert_eq!(block.text(), " Foo\n Bar "); assert_eq!(block.raw(), "/* Foo\n Bar */");
Variants
LineComment(raw, text)
BlockComment(raw, text)
Methods
impl<'a> Event<'a>
[src]
pub fn raw(&self) -> &str
[src]
Returns the raw part of an Event
.
pub fn text(&self) -> &str
[src]
Returns the text part of an Event
.
Trait Implementations
impl<'a> Clone for Event<'a>
[src]
impl<'a> Debug for Event<'a>
[src]
impl<'a> PartialEq<Event<'a>> for Event<'a>
[src]
impl<'a> StructuralPartialEq for Event<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,