pub enum FoldResult<F, R> {
StreamEnded(F),
ShortCircuited(R),
}
Expand description
The result of folding a stream.
Variants§
StreamEnded(F)
The stream ended with folded state F
.
ShortCircuited(R)
The stream was short-cirtuited with result R
.
Implementations§
Source§impl<F, R> FoldResult<F, R>
impl<F, R> FoldResult<F, R>
Sourcepub fn ended(self) -> Result<F, R>
pub fn ended(self) -> Result<F, R>
Transforms into Result
mapping the FoldResult::StreamEnded
variant into Ok
.
Sourcepub fn short_circuited(self) -> Result<R, F>
pub fn short_circuited(self) -> Result<R, F>
Transforms into Result
mapping the FoldResult::ShortCircuited
variant into Ok
.
Source§impl<F> FoldResult<F, F>
impl<F> FoldResult<F, F>
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Unwraps this FoldResult
into its inner value, discarding the variant
information.
Trait Implementations§
Source§impl<F: Clone, R: Clone> Clone for FoldResult<F, R>
impl<F: Clone, R: Clone> Clone for FoldResult<F, R>
Source§fn clone(&self) -> FoldResult<F, R>
fn clone(&self) -> FoldResult<F, R>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<F: Copy, R: Copy> Copy for FoldResult<F, R>
impl<F: Eq, R: Eq> Eq for FoldResult<F, R>
impl<F, R> StructuralPartialEq for FoldResult<F, R>
Auto Trait Implementations§
impl<F, R> Freeze for FoldResult<F, R>
impl<F, R> RefUnwindSafe for FoldResult<F, R>where
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<F, R> Send for FoldResult<F, R>
impl<F, R> Sync for FoldResult<F, R>
impl<F, R> Unpin for FoldResult<F, R>
impl<F, R> UnwindSafe for FoldResult<F, R>where
F: UnwindSafe,
R: 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
)