fuchsia_bluetooth::expectation::asynchronous

Trait ExpectableStateExt

Source
pub trait ExpectableStateExt: ExpectableState + Sized {
    // Required method
    fn when_satisfied(
        &self,
        expectation: Predicate<Self::State>,
        timeout: MonotonicDuration,
    ) -> BoxFuture<'_, Result<Self::State, Error>>;
}

Required Methods§

Source

fn when_satisfied( &self, expectation: Predicate<Self::State>, timeout: MonotonicDuration, ) -> BoxFuture<'_, Result<Self::State, Error>>

Convenience method for awaiting expectations on the underlying state Provides a simple syntax for asynchronously awaiting expectations:

  // Wait for the action to have completed one way or the other
  let state = state.when_satisfied(action_complete, timeout).await?;

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> ExpectableStateExt for T
where T: Send + Sync + 'static + ExpectableState + Sized, T::State: Send + Sync + 'static,