pub trait ProviderExt<T>: Sized + Provider<T>{
// Provided methods
fn map<R, F>(self, transform: F) -> Map<T, R, F, Self>
where R: Send + Sync + Clone,
F: Fn(T) -> R + Send + Sync,
Self: 'static { ... }
fn flat_map<R, P, F>(self, transform: F) -> FlatMap<T, R, Self, P, F>
where R: Send + Sync + Clone,
P: Provider<R>,
F: Fn(T) -> P + Send + Sync { ... }
fn flatten<B>(self) -> FlatMap<T, B, Self, T, fn(T) -> T>
where Self: Clone + 'static,
T: Provider<B>,
B: Clone + Send + Sync { ... }
fn zip<P, B, R, F>(self, other: P, func: F) -> Zip<T, B, R, F>
where Self: 'static,
P: IntoProvider<B>,
<P as IntoProvider<B>>::Provider: 'static,
B: Send + Sync + Clone,
R: Send + Sync + Clone,
F: Fn(T, B) -> R + Send + Sync { ... }
}
Expand description
Provides extensions that are not object safe to the Provider trait.
Provided Methods§
Sourcefn map<R, F>(self, transform: F) -> Map<T, R, F, Self>
fn map<R, F>(self, transform: F) -> Map<T, R, F, Self>
Creates a provider that can map the output of one provider into some other value.
transform
: fn(T) -> R
Sourcefn flat_map<R, P, F>(self, transform: F) -> FlatMap<T, R, Self, P, F>
fn flat_map<R, P, F>(self, transform: F) -> FlatMap<T, R, Self, P, F>
Creates a provider that can map the output of one provider with type T
into some other value that’s
also a provider of type R
. The created provider is a provider of type R
transform
: fn(T) -> impl Provider<R>
Sourcefn flatten<B>(self) -> FlatMap<T, B, Self, T, fn(T) -> T>
fn flatten<B>(self) -> FlatMap<T, B, Self, T, fn(T) -> T>
Flattens a provider that provides another provider
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.