Output

Enum Output 

Source
pub enum Output<'machine> {
    Authenticate {
        client: &'machine str,
        passdata: Option<&'machine [u8]>,
    },
    Recover {
        code: &'machine str,
    },
    Extend {
        extensions: &'machine mut Extensions,
    },
    Issue {
        grant: &'machine Grant,
    },
    Ok(BearerToken),
    Err(Box<Error>),
}
Expand description

A request by the statemachine to the executor.

Each variant is fulfilled by certain variants of the next inputs as an argument to AccessToken::advance. The output of most states is simply repeated if Input::None is provided instead but note that the successful bearer token response is not repeated.

Variants§

§

Authenticate

The registrar should authenticate a client.

Fulfilled by Input::Authenticated. In an unsuccessful case, the executor should not continue and discard the flow.

Fields

§client: &'machine str

The to-be-authenticated client.

§passdata: Option<&'machine [u8]>

The supplied passdata/password.

§

Recover

The issuer should try to recover the grant for this code

Fulfilled by Input::Recovered.

Fields

§code: &'machine str

The code from current request

§

Extend

The extension (if any) should provide the extensions

Fullfilled by Input::Extended

Fields

§extensions: &'machine mut Extensions

The grant extensions if any

§

Issue

The issue should issue a new access token

Fullfilled by Input::Issued

Fields

§grant: &'machine Grant

The grant to be used in the token generation

§

Ok(BearerToken)

The state machine finished and a new bearer token was generated

This output can not be requested repeatedly, any future Input will yield a primitive error instead.

§

Err(Box<Error>)

The state machine finished in an error.

The error will be repeated on any following input.

Auto Trait Implementations§

§

impl<'machine> Freeze for Output<'machine>

§

impl<'machine> RefUnwindSafe for Output<'machine>

§

impl<'machine> Send for Output<'machine>

§

impl<'machine> Sync for Output<'machine>

§

impl<'machine> Unpin for Output<'machine>

§

impl<'machine> !UnwindSafe for Output<'machine>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V