fuchsia_bluetooth::expectation::asynchronous

Type Alias Expectable

Source
pub type Expectable<S, A> = Arc<RwLock<ExpectableInner<S, A>>>;
Expand description

Expectable<S,A> is an easy way to build an implementation of ExpectableState to await upon. The Aux type A is commonly used to hold a FIDL Proxy to drive the behavior under test.

Aliased Type§

struct Expectable<S, A> { /* private fields */ }

Trait Implementations§

Source§

impl<S, A> ExpectableExt<S, A> for Expectable<S, A>

Source§

fn aux(&self) -> MappedRwLockWriteGuard<'_, A>

Mutable access the auxilliary data
Source§

fn write_state(&self) -> MappedRwLockWriteGuard<'_, S>

Mutable access to the state
Source§

impl<S: Clone + 'static, A> ExpectableState for Expectable<S, A>

Source§

fn store_task(&mut self, cx: &mut Context<'_>) -> usize

Register a task as needing waking when state changes

Source§

fn remove_task(&mut self, key: usize)

Remove a task from being tracked

Source§

fn notify_state_changed(&self)

Notify all pending tasks that state has changed

Source§

type State = S

Type of current state we are tracking
Source§

fn read(&self) -> Self::State

Read a snapshot of the current State