Skip to main content

Restore

Trait Restore 

Source
pub trait Restore:
    Send
    + Sized
    + 'static {
    type Client: Sync;

    const WHAT: &'static str;

    // Required methods
    fn connect() -> Result<Connected<Self::Client>, Error>;
    fn restore(
        &self,
        client: &Self::Client,
    ) -> impl Future<Output = Result<(), Failure>> + Send;

    // Provided method
    fn restore_new(
        &self,
        client: &Self::Client,
    ) -> impl Future<Output = Result<(), Failure>> + Send { ... }
}
Expand description

Modem state that a test changed and must set back.

Required Associated Constants§

Source

const WHAT: &'static str

What the test changed, for messages.

Required Associated Types§

Source

type Client: Sync

The client that restores the state.

Required Methods§

Source

fn connect() -> Result<Connected<Self::Client>, Error>

Connects a client that can restore the state.

§Errors

Returns an error if the client can’t connect.

Source

fn restore( &self, client: &Self::Client, ) -> impl Future<Output = Result<(), Failure>> + Send

Sets the state back.

Provided Methods§

Source

fn restore_new( &self, client: &Self::Client, ) -> impl Future<Output = Result<(), Failure>> + Send

Sets the state back with a new client from Restore::connect.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§