[−][src]Struct join_impl::expr_chain::group::GroupDeterminer
GroupDeterminer
is used to determine any CommandGroup
or separator (for ex. ,
) in ParseStream
Methods
impl GroupDeterminer
[src]
pub const fn new_const(
group_type: Option<CommandGroup>,
check_input_fn: *const (),
validate_parsed: bool,
length: u8
) -> Self
[src]
group_type: Option<CommandGroup>,
check_input_fn: *const (),
validate_parsed: bool,
length: u8
) -> Self
Constructs new GroupDeterminer
using const fn
(can be used to create const or static item).
Example:
extern crate join_impl; extern crate syn; use syn::Token; use syn::parse::ParseStream; use join_impl::expr_chain::group::GroupDeterminer; fn check_input(input: ParseStream) -> bool { input.peek(Token![,]) } fn main() { let first_comma_determiner = GroupDeterminer::new_const( None, // Because comma is not a command group check_input as *const (), false, 1 ); }
pub fn new(
group_type: impl Into<Option<CommandGroup>>,
check_input_fn: CheckStreamFn,
validate_parsed: bool,
length: u8
) -> Self
[src]
group_type: impl Into<Option<CommandGroup>>,
check_input_fn: CheckStreamFn,
validate_parsed: bool,
length: u8
) -> Self
Constructs new GroupDeterminer
.
Example:
extern crate join_impl; extern crate syn; use syn::Token; use syn::parse::ParseStream; use join_impl::expr_chain::group::GroupDeterminer; fn check_input(input: ParseStream) -> bool { input.peek(Token![,]) } fn main() { let first_comma_determiner = GroupDeterminer::new( None, // Because comma is not a command group check_input, false, 1 ); }
pub fn get_group_type(&self) -> Option<CommandGroup>
[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<T: Parse>(&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<'b>(&self, input: ParseStream<'b>) -> Result<ParseStream<'b>>
[src]
Used to parse length
tokens of type TokenTree
from input ParseStream
.
pub fn length(&self) -> u8
[src]
Returns value of length
field.
Trait Implementations
impl Clone for GroupDeterminer
[src]
fn clone(&self) -> GroupDeterminer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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> 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 = !
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,