Trait Whenable

Source
pub trait Whenable<D: 'static> {
    // Required method
    fn when(
        &self,
        assert_fn: Box<dyn Fn(&D) -> bool>,
    ) -> LocalBoxFuture<'static, Result<(), DroppedError>>;
}
Expand description

Abstraction over ObservableField::when and ObservableField::when_eq implementations for custom types.

Required Methods§

Source

fn when( &self, assert_fn: Box<dyn Fn(&D) -> bool>, ) -> LocalBoxFuture<'static, Result<(), DroppedError>>

This function will be called on ObservableField::when.

Should return LocalBoxFuture to which will be sent () when provided assert_fn returns true.

Implementations on Foreign Types§

Source§

impl<D: 'static> Whenable<D> for RefCell<Vec<UniversalSubscriber<D>>>

Source§

fn when( &self, assert_fn: Box<dyn Fn(&D) -> bool>, ) -> LocalBoxFuture<'static, Result<(), DroppedError>>

Implementors§