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

Object Safety§

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>