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§
Sourcefn when(
&self,
assert_fn: Box<dyn Fn(&D) -> bool>,
) -> LocalBoxFuture<'static, Result<(), DroppedError>>
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
.