Struct pex::helpers::CommentLine
source · pub struct CommentLine { /* private fields */ }
Expand description
Parse a comment line, note this does not catch the newline, catch all if reach EOF
Patterns
# comment
// comment
Examples
let test1 = ParseState::new("# comment hash\r text text");
let test2 = ParseState::new("// comment slash\n 123456");
assert_eq!(CommentLine::new("#")(test1).unwrap().body.as_string(), " comment hash");
assert_eq!(CommentLine::new("//")(test2).unwrap().body.as_string(), " comment slash");
Implementations§
Trait Implementations§
source§impl Clone for CommentLine
impl Clone for CommentLine
source§fn clone(&self) -> CommentLine
fn clone(&self) -> CommentLine
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 CommentLine
impl Debug for CommentLine
source§impl<'i> FnOnce(ParseState<'i>) for CommentLine
impl<'i> FnOnce(ParseState<'i>) for CommentLine
§type Output = ParseResult<'i, SurroundPair<'i>>
type Output = ParseResult<'i, SurroundPair<'i>>
The returned type after the call operator is used.
source§extern "rust-call" fn call_once(
self,
(input): (ParseState<'i>,)
) -> Self::Output
extern "rust-call" fn call_once( self, (input): (ParseState<'i>,) ) -> Self::Output
🔬This is a nightly-only experimental API. (
fn_traits
)Performs the call operation.
impl Copy for CommentLine
Auto Trait Implementations§
impl RefUnwindSafe for CommentLine
impl Send for CommentLine
impl Sync for CommentLine
impl Unpin for CommentLine
impl UnwindSafe for CommentLine
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