pub struct Reverse<I>(pub I)
where
I: Iterable,
I::Iter: DoubleEndedIterator;
Expand description
Stream that goes over an [ExactSizeIterator]
in reverse order.
This stream allows to switch fast from little endian ordering used in
time-efficient algorithms, e.g. in slices &[T]
into big endia ordering
(used in space-efficient algorithms.
§Examples
use ark_std::iterable::{Iterable, Reverse};
let le_v = &[1, 2, 3];
let be_v = Reverse(le_v);
let mut be_v_iter = be_v.iter();
assert_eq!(be_v_iter.next(), Some(&3));
assert_eq!(be_v_iter.next(), Some(&2));
assert_eq!(be_v_iter.next(), Some(&1));
Tuple Fields§
§0: I
Trait Implementations§
Source§impl<I> Iterable for Reverse<I>
impl<I> Iterable for Reverse<I>
impl<I> Copy for Reverse<I>
Auto Trait Implementations§
impl<I> Freeze for Reverse<I>where
I: Freeze,
impl<I> RefUnwindSafe for Reverse<I>where
I: RefUnwindSafe,
impl<I> Send for Reverse<I>
impl<I> Sync for Reverse<I>
impl<I> Unpin for Reverse<I>where
I: Unpin,
impl<I> UnwindSafe for Reverse<I>where
I: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)