Enum fxa_client::FxaEvent

source ·
pub enum FxaEvent {
    Initialize {
        device_config: DeviceConfig,
    },
    BeginOAuthFlow {
        scopes: Vec<String>,
        entrypoint: String,
    },
    BeginPairingFlow {
        pairing_url: String,
        scopes: Vec<String>,
        entrypoint: String,
    },
    CompleteOAuthFlow {
        code: String,
        state: String,
    },
    CancelOAuthFlow,
    CheckAuthorizationStatus,
    Disconnect,
    CallGetProfile,
}
Expand description

Fxa event

These are the events that consumers send to [crate::FxaStateMachine::process_event]

Variants§

§

Initialize

Fields

§device_config: DeviceConfig

Initialize the state machine. This must be the first event sent.

§

BeginOAuthFlow

Fields

§scopes: Vec<String>
§entrypoint: String

Begin an oauth flow

If successful, the state machine will transition the FxaState::Authenticating. The next step is to navigate the user to the oauth_url and let them sign and authorize the client.

§

BeginPairingFlow

Fields

§pairing_url: String
§scopes: Vec<String>
§entrypoint: String

Begin an oauth flow using a URL from a pairing code

If successful, the state machine will transition the FxaState::Authenticating. The next step is to navigate the user to the oauth_url and let them sign and authorize the client.

§

CompleteOAuthFlow

Fields

§code: String
§state: String

Complete an OAuth flow.

Send this event after the user has navigated through the OAuth flow and has reached the redirect URI. Extract code and state from the query parameters or web channel. If successful the state machine will transition to FxaState::Connected.

§

CancelOAuthFlow

Cancel an OAuth flow.

Use this to cancel an in-progress OAuth, returning to FxaState::Disconnected so the process can begin again.

§

CheckAuthorizationStatus

Check the authorization status for a connected account.

Send this when issues are detected with the auth tokens for a connected account. It will double check for authentication issues with the account. If it detects them, the state machine will transition to FxaState::AuthIssues. From there you can start an OAuth flow again to re-connect the user.

§

Disconnect

Disconnect the user

Send this when the user is asking to be logged out. The state machine will transition to FxaState::Disconnected.

§

CallGetProfile

Force a call to FirefoxAccount::get_profile

This is used for testing the auth/network retry code, since it hits the network and requires and auth token.

Trait Implementations§

source§

impl Clone for FxaEvent

source§

fn clone(&self) -> FxaEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FxaEvent

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for FxaEvent

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq for FxaEvent

source§

fn eq(&self, other: &FxaEvent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for FxaEvent

source§

impl StructuralEq for FxaEvent

source§

impl StructuralPartialEq for FxaEvent

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for Twhere T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<>
§

fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V