Skip to main content

Onboarding

Enum Onboarding 

Source
pub enum Onboarding {
    Connecting,
    Asking {
        device: String,
    },
    Denied {
        device: String,
    },
    AlreadyPending {
        device: String,
    },
    GaveUp(String),
    Reauthorizing {
        device: String,
        was_expired: bool,
    },
}
Expand description

Where this device stands on its way to a first delta.

Worth showing to a caller directly: approval can take minutes, and an interface that stays empty in the meantime is indistinguishable from a broken one.

Variants§

§

Connecting

Listening for the server, or opening the connection to one.

§

Asking

Waiting for a human to approve this device, under the name it asked as.

Fields

§device: String

What the administrator will see in the approval list.

§

Denied

The administrator looked and said no.

Fields

§device: String

The name that was refused.

§

AlreadyPending

The server already holds a request under this name that this run has no way to poll – typically a stray one left over from an earlier run whose own record of it was lost. Unlike Self::Asking, this run will not notice an approval on its own; deciding it on the server clears the way, but this run itself needs a restart to try again after that.

Fields

§device: String

The name whose earlier request is being waited on.

§

GaveUp(String)

Gave up before ever connecting, in log words rather than translated – there is no small set of reasons to enumerate here, only whatever the network or the server said.

§

Reauthorizing

The token this installation held was refused with 401 Unauthorized, discarded, and a fresh request just went out under the same name.

Fields

§device: String

What the fresh request is going out under.

§was_expired: bool

Whether the discarded token’s own exp claim said it had already expired, read before it was thrown away. false also covers a token with no expiry claim at all, refused for some other reason – revoked by the administrator, most likely – that only the server’s own log would show; a 401 alone cannot tell the two apart.

Trait Implementations§

Source§

impl Clone for Onboarding

Source§

fn clone(&self) -> Onboarding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Onboarding

Source§

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

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

impl Eq for Onboarding

Source§

impl PartialEq for Onboarding

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Onboarding

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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