pub trait TryTools<T, E, S>{
// Required methods
fn try_take(
self,
n: usize,
) -> TryTakeWhile<Self, Ready<Result<bool, S::Error>>, impl FnMut(&S::Ok) -> Ready<Result<bool, S::Error>>>;
fn try_unzip<FromA, FromB>(
self,
) -> impl Future<Output = Result<(FromA, FromB), S::Error>>
where (FromA, FromB): Default + Extend<T>;
fn try_unzip_partial<FromA, FromB, FromE>(
self,
) -> impl Future<Output = ((FromA, FromB), FromE)>
where (FromA, FromB): Default + Extend<T>,
FromE: Default + Extend<E>;
}Expand description
Adds general-purpose operations to fallible streams.
Operations preserve the source error type and process successful items in source order. They support limiting the stream and collecting successful pairs, with or without the errors beside them.
Required Methods§
Sourcefn try_take(
self,
n: usize,
) -> TryTakeWhile<Self, Ready<Result<bool, S::Error>>, impl FnMut(&S::Ok) -> Ready<Result<bool, S::Error>>>
fn try_take( self, n: usize, ) -> TryTakeWhile<Self, Ready<Result<bool, S::Error>>, impl FnMut(&S::Ok) -> Ready<Result<bool, S::Error>>>
Limits the stream to at most n successful items.
After yielding n successes, the adapter consumes one additional
success to detect the limit. Earlier source errors are still forwarded;
with zero, they precede consumption of the first unyielded success.
Sourcefn try_unzip<FromA, FromB>(
self,
) -> impl Future<Output = Result<(FromA, FromB), S::Error>>
fn try_unzip<FromA, FromB>( self, ) -> impl Future<Output = Result<(FromA, FromB), S::Error>>
Collects successful pairs into two collections.
Collections are extended in source order, starting from their defaults. The first source error ends the fold without returning partial collections.
Sourcefn try_unzip_partial<FromA, FromB, FromE>(
self,
) -> impl Future<Output = ((FromA, FromB), FromE)>
fn try_unzip_partial<FromA, FromB, FromE>( self, ) -> impl Future<Output = ((FromA, FromB), FromE)>
Collects successful pairs into two collections and every error into a third.
Collections are extended in source order, starting from their defaults.
Unlike Self::try_unzip, an error does not end the fold.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".