Struct pex::helpers::CommentBlock
source · pub struct CommentBlock { /* private fields */ }
Expand description
Parse the comment block
Patterns
/** comment */
(* comment *)
Examples
let test1 = ParseState::new("(* comment *) 123456");
let test2 = ParseState::new("/** comment **/ 123456");
assert_eq!(CommentBlock::new("(*", "*)")(test1).unwrap().body.as_string(), " comment ");
assert_eq!(CommentBlock::new("/*", "*/")(test2).unwrap().body.as_string(), "* comment *");
Implementations§
source§impl CommentBlock
impl CommentBlock
Trait Implementations§
source§impl Clone for CommentBlock
impl Clone for CommentBlock
source§fn clone(&self) -> CommentBlock
fn clone(&self) -> CommentBlock
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 CommentBlock
impl Debug for CommentBlock
source§impl<'i> Fn(ParseState<'i>) for CommentBlock
impl<'i> Fn(ParseState<'i>) for CommentBlock
source§extern "rust-call" fn call(
&self,
args: (ParseState<'i>,)
) -> Self::Output
extern "rust-call" fn call( &self, args: (ParseState<'i>,) ) -> Self::Output
🔬This is a nightly-only experimental API. (
fn_traits
)Performs the call operation.
source§impl<'i> FnMut(ParseState<'i>) for CommentBlock
impl<'i> FnMut(ParseState<'i>) for CommentBlock
source§extern "rust-call" fn call_mut(
&mut self,
args: (ParseState<'i>,)
) -> Self::Output
extern "rust-call" fn call_mut( &mut self, args: (ParseState<'i>,) ) -> Self::Output
🔬This is a nightly-only experimental API. (
fn_traits
)Performs the call operation.
source§impl<'i> FnOnce(ParseState<'i>) for CommentBlock
impl<'i> FnOnce(ParseState<'i>) for CommentBlock
§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 CommentBlock
Auto Trait Implementations§
impl RefUnwindSafe for CommentBlock
impl Send for CommentBlock
impl Sync for CommentBlock
impl Unpin for CommentBlock
impl UnwindSafe for CommentBlock
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