Trait GuardSpec

Source
pub trait GuardSpec<T> {
    type State;
    type Error;
    type Idle: GuardSpec<T, Error = Self::Error>;

    // Required methods
    fn validate(
        target: &T,
        op_id: Option<u64>,
    ) -> Result<&Self::State, Self::Error>;
    fn set_state(target: &mut T, state: Self::State);
    fn into_idle(target: &mut T);
}

Required Associated Types§

Source

type State

Source

type Error

Source

type Idle: GuardSpec<T, Error = Self::Error>

Required Methods§

Source

fn validate(target: &T, op_id: Option<u64>) -> Result<&Self::State, Self::Error>

§Errors

Returns Self::Error if the target is not in the expected state.

Source

fn set_state(target: &mut T, state: Self::State)

Source

fn into_idle(target: &mut T)

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§