Trait ProviderExt

Source
pub trait ProviderExt<T>: Sized + Provider<T>
where T: Clone + Send + Sync,
{ // 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§

Source

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,

Creates a provider that can map the output of one provider into some other value.

transform: fn(T) -> R

Source

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,

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>

Source

fn flatten<B>(self) -> FlatMap<T, B, Self, T, fn(T) -> T>
where Self: Clone + 'static, T: Provider<B>, B: Clone + Send + Sync,

Flattens a provider that provides another provider

Source

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,

Creates a provider that can map the output of two provider with type T1 and T2 into some other value and transforms the two values into one output value of type B.

transform: fn(T1, T2) -> B

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.

Implementors§

Source§

impl<P, T> ProviderExt<T> for P
where T: Clone + Send + Sync, P: Provider<T> + Send + Sync + 'static,