[−][src]Struct join_impl::expr_chain::group::GroupDeterminer
Methods
impl GroupDeterminer
[src]
pub fn new(
group_type: impl Into<Option<ActionGroup>>,
check_input_fn: Box<dyn Fn(ParseStream) -> bool>,
check_parsed_fn: Option<Box<dyn Fn(TokenStream) -> bool>>,
length: usize
) -> Self
[src]
group_type: impl Into<Option<ActionGroup>>,
check_input_fn: Box<dyn Fn(ParseStream) -> bool>,
check_parsed_fn: Option<Box<dyn Fn(TokenStream) -> bool>>,
length: usize
) -> Self
Constructs new GroupDeterminer
.
Example:
extern crate join_impl; extern crate syn; use syn::Token; use join_impl::expr_chain::group::GroupDeterminer; fn main() { let first_comma_determiner = GroupDeterminer::new( None, // Because comma is not an action group Box::new(|input| input.peek(Token![,])), None, 1 ); }
pub fn get_group_type(&self) -> Option<ActionGroup>
[src]
Returns type of group of GroupDeterminer
.
pub fn check_input(&self, input: ParseStream) -> bool
[src]
Checks if input next tokens are of self group type.
pub fn check_parsed(&self, input: TokenStream) -> bool
[src]
Checks already parsed tokens. In many cases it's used to check if parsed tokens are valid expression. in this case we can say for sure that we found separator.
pub fn erase_input<'a>(&self, input: ParseStream<'a>) -> Result<ParseStream<'a>>
[src]
Used to parse length
tokens of type TokenTree
from input ParseStream
.
pub fn length(&self) -> usize
[src]
Returns value of length
field.
Auto Trait Implementations
impl !Send for GroupDeterminer
impl !Sync for GroupDeterminer
impl Unpin for GroupDeterminer
impl !UnwindSafe for GroupDeterminer
impl !RefUnwindSafe for GroupDeterminer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,