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

§

type State = S

Type of current state we are tracking
source§

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

Read a snapshot of the current State