pub struct To<'a, A, D>(pub A, pub &'a Dest<D>);Expand description
A pattern that captures matched items into a destination.
Tuple Fields§
§0: A§1: &'a Dest<D>Trait Implementations§
Source§impl<'a, Reference, A, OutD, InD> Pattern<'a, Reference> for To<'a, A, OutD>where
Reference: Iterator + PeekableExt,
A: Pattern<'a, Reference, Dest = InD>,
InD: Destination<Reference::Item> + Default + Clone,
OutD: Collector<InD, Reference::Item> + Destination<Reference::Item> + Clone,
impl<'a, Reference, A, OutD, InD> Pattern<'a, Reference> for To<'a, A, OutD>where
Reference: Iterator + PeekableExt,
A: Pattern<'a, Reference, Dest = InD>,
InD: Destination<Reference::Item> + Default + Clone,
OutD: Collector<InD, Reference::Item> + Destination<Reference::Item> + Clone,
type Iter = <A as Pattern<'a, Reference>>::Iter
type Dest = OutD
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 consume(&'a self, reference: &mut Reference) -> bool
fn consume(&'a self, reference: &mut Reference) -> bool
Consume items from the reference iterator.
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.
Auto Trait Implementations§
impl<'a, A, D> Freeze for To<'a, A, D>where
A: Freeze,
impl<'a, A, D> !RefUnwindSafe for To<'a, A, D>
impl<'a, A, D> !Send for To<'a, A, D>
impl<'a, A, D> !Sync for To<'a, A, D>
impl<'a, A, D> Unpin for To<'a, A, D>where
A: Unpin,
impl<'a, A, D> !UnwindSafe for To<'a, A, D>
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