Enum Output

Source
pub enum Output<'a> {
    Unauthenticated {
        client: &'a str,
        pass: Option<&'a [u8]>,
    },
    RecoverRefresh {
        token: &'a str,
    },
    Refresh {
        token: &'a str,
        grant: Box<Grant>,
    },
    Ok(BearerToken),
    Err(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 Refresh::next. 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.

This borrows data from the underlying state machine, so you need to drop it before advancing it with newly provided input.

Variants§

§

Unauthenticated

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: &'a str

The to-be-authenticated client.

§pass: Option<&'a [u8]>

The supplied passdata/password.

§

RecoverRefresh

The issuer should try to recover the grant of a refresh token.

Fulfilled by Input::Recovered.

Fields

§token: &'a str

The token supplied by the client.

§

Refresh

The issuer should issue a refreshed code grant token.

Fulfilled by Input::Refreshed.

Fields

§token: &'a str

The refresh token that has been used.

§grant: Box<Grant>

The grant that should be issued as determined.

§

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(Error)

The state machine finished in an error.

The error will be repeated on any following input.

Trait Implementations§

Source§

impl<'a> Debug for Output<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Output<'a>

§

impl<'a> RefUnwindSafe for Output<'a>

§

impl<'a> Send for Output<'a>

§

impl<'a> Sync for Output<'a>

§

impl<'a> Unpin for Output<'a>

§

impl<'a> UnwindSafe for Output<'a>

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,