pub struct Seq<A, const N: usize>(pub [A; N]);Expand description
A pattern that matches a sequence of sub-patterns.
Tuple Fields§
§0: [A; N]Trait Implementations§
Source§impl<'a, Reference, A, D, const N: usize> Pattern<'a, Reference> for Seq<A, N>
impl<'a, Reference, A, D, const N: usize> Pattern<'a, Reference> for Seq<A, N>
type Iter = Peekable<Empty<<Reference as Iterator>::Item>>
type Dest = Vec<D>
Source§fn consume_with_dest(
&'a self,
reference: &mut Reference,
dest: Option<&RefCell<Self::Dest>>,
) -> bool
fn consume_with_dest( &'a self, reference: &mut Reference, dest: Option<&RefCell<Self::Dest>>, ) -> bool
Consume items from the reference iterator, optionally storing matched items in a destination.
Source§fn get_dest_mut(&self) -> Option<RefMut<'_, Self::Dest>>
fn get_dest_mut(&self) -> Option<RefMut<'_, Self::Dest>>
Get a mutable reference to the pattern’s internal destination, if any.
Source§fn matches<'s, R>(&'a self, reference: &'s R) -> boolwhere
R: Iterable<'s, Iter = Reference> + 's,
Self::Dest: Destination<Reference::Item>,
Reference: PeekableExt,
Reference::Item: Satisfies<<Self::Iter as Iterator>::Item>,
fn matches<'s, R>(&'a self, reference: &'s R) -> boolwhere
R: Iterable<'s, Iter = Reference> + 's,
Self::Dest: Destination<Reference::Item>,
Reference: PeekableExt,
Reference::Item: Satisfies<<Self::Iter as Iterator>::Item>,
Match the pattern against the reference iterator.
Source§fn consume(&'a self, reference_iter: &mut Reference) -> boolwhere
Reference: PeekableExt,
Self::Dest: Destination<Reference::Item>,
Reference::Item: Satisfies<<Self::Iter as Iterator>::Item>,
fn consume(&'a self, reference_iter: &mut Reference) -> boolwhere
Reference: PeekableExt,
Self::Dest: Destination<Reference::Item>,
Reference::Item: Satisfies<<Self::Iter as Iterator>::Item>,
Consume items from the reference iterator.
Auto Trait Implementations§
impl<A, const N: usize> Freeze for Seq<A, N>where
A: Freeze,
impl<A, const N: usize> RefUnwindSafe for Seq<A, N>where
A: RefUnwindSafe,
impl<A, const N: usize> Send for Seq<A, N>where
A: Send,
impl<A, const N: usize> Sync for Seq<A, N>where
A: Sync,
impl<A, const N: usize> Unpin for Seq<A, N>where
A: Unpin,
impl<A, const N: usize> UnwindSafe for Seq<A, N>where
A: UnwindSafe,
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