Trait Dependency

Source
pub trait Dependency<T> {
    // Required method
    fn completed(self) -> impl Future<Output = Option<T>> + Send;

    // Provided methods
    fn or<D: Dependency<T> + Send + 'static>(self, dep: D) -> OrDependency<T>
       where T: Send + Sync + Clone + 'static,
             Self: Sized + Send + 'static { ... }
    fn and<D: Dependency<T> + Send + 'static>(self, dep: D) -> AndDependency<T>
       where T: Send + Sync + Clone + 'static,
             Self: Sized + Send + 'static { ... }
}
Expand description

Type which describes the idea of waiting for a dependency to complete

Required Methods§

Source

fn completed(self) -> impl Future<Output = Option<T>> + Send

Complete will wait until it gets some value T then return the value

Provided Methods§

Source

fn or<D: Dependency<T> + Send + 'static>(self, dep: D) -> OrDependency<T>
where T: Send + Sync + Clone + 'static, Self: Sized + Send + 'static,

Create an or dependency from this dependency and another

Source

fn and<D: Dependency<T> + Send + 'static>(self, dep: D) -> AndDependency<T>
where T: Send + Sync + Clone + 'static, Self: Sized + Send + 'static,

Create an and dependency from this dependency and another

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<T: Clone + Send + Sync + 'static> Dependency<T> for EventDependency<T>

Source§

impl<T: Clone + Send + Sync> Dependency<Vec<T>> for AndDependency<T>

Source§

impl<T: Clone + Send + Sync> Dependency<T> for OrDependency<T>