pub struct Seq<T>(_);
Expand description
A lazily evaluated sequence of functions.
Implementations
sourceimpl<T> Seq<T>
impl<T> Seq<T>
pub fn capacity(&self) -> usize
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements in the sequence, also referred to as its ‘length’.
sourcepub fn with_capacity(capacity: usize) -> Seq<T>
pub fn with_capacity(capacity: usize) -> Seq<T>
Constructs a new, empty Seq<T>
with the specified capacity.
sourcepub fn push<F: FnOnce() -> T + 'static>(&mut self, value: F)
pub fn push<F: FnOnce() -> T + 'static>(&mut self, value: F)
Appends the provided function to the back of the collection.
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Forces evaluation of the last function in the sequence, returning the result.
sourcepub fn to_vec(self) -> Vec<T>
pub fn to_vec(self) -> Vec<T>
Converts a Seq<T>
to a Vec<T>
by forcing evaluation of all functions.
sourcepub fn to_lazy_vec(self) -> Vec<Lazy<T>>
pub fn to_lazy_vec(self) -> Vec<Lazy<T>>
Converts a Seq<T>
to a Vec<Lazy<T>>
without evaluating any additional
functions.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Seq<T>
impl<T> !Send for Seq<T>
impl<T> !Sync for Seq<T>
impl<T> Unpin for Seq<T> where
T: Unpin,
impl<T> !UnwindSafe for Seq<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more