Skip to main content
QAROS Rust API Dev (main) · versions: Dev (main) · Developer Guide

OnboardMethod

Enum OnboardMethod 

Source
pub enum OnboardMethod<'a> {
    Code {
        code: &'a str,
        hub: Option<HubAddress<'a>>,
    },
    Invite(&'a OnboardingInvite),
    LocalApp {
        approval_timeout: Option<Duration>,
        app_tag: Option<&'a str>,
    },
}
Expand description

The onboarding path, chained as exactly one mode extension. An app joins in one of three ways: as a local app (OnboardMethod::LocalApp), as a companion of a local app (OnboardMethod::Invite with the app’s crate::Session::request_onboarding_invite), or through a member hub (OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant).

Variants§

§

Code

👎Deprecated:

code onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)

A short pairing code minted for the hub’s operators (the QAROS Visualizer shows none: its hub join code is for another hub only). Without an address the library finds only this user’s hub: through the hub-endpoint.json the hub writes to the QAROS data root, then a discovery beacon whose owner is this user (up to 6 s), else crate::StatusCode::ONBOARDING_HUB_UNREACHABLE. Any other hub needs its host and port in hub.

Fields

§code: &'a str
👎Deprecated:

code onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)

§hub: Option<HubAddress<'a>>
👎Deprecated:

code onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)

§

Invite(&'a OnboardingInvite)

An invite: a co-process invite from the local app that started this process (crate::Session::request_onboarding_invite), or one the hub’s operators minted. The invite is borrowed for the call (for Runtime::start_onboard, for the start call, during which the library copies it).

§

LocalApp

A source app joining the QAROS hub installed on this PC, with no code (QarOnboardLocalAppExt, Windows only). The first start of an app waits until a person allows it in the hub, at most approval_timeout (None: the hub’s default of 120 s). The C API reads a zero timeout as that default, so a duration under 1 ms (Duration::ZERO included) or over u32::MAX milliseconds fails with crate::Error::InvalidArgument before the call; pass None for the default. A refusal ends in one of the ONBOARDING_APPROVAL_*, ONBOARDING_HUB_NOT_AUTHENTIC or ONBOARDING_APP_IDENTITY_MISMATCH codes, see crate::StatusCode::user_action. Stateless: nothing to persist, every start onboards again.

app_tag (QarOnboardLocalAppTagExt) names this instance of the app: the hub remembers one peer id per approval and tag, so the next start with the same tag gets the same peer id back while no other live process holds it. An identity key: printable ASCII, no space at either end, at most QAR_MAX_APP_TAG_LENGTH bytes, never starting with member/, and constant across versions of the app; anything else fails with crate::StatusCode::ARGUMENT_NOT_SUPPORTED. None is the default tag, remembered the same way. Give instances that run together different tags.

A member hub’s remote-app grant is redeemed with OnboardExtensions::remote_app_grant next to this mode.

Fields

§approval_timeout: Option<Duration>
§app_tag: Option<&'a str>

Trait Implementations§

Source§

impl<'a> Clone for OnboardMethod<'a>

Source§

fn clone(&self) -> Self

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<'a> Copy for OnboardMethod<'a>

Source§

impl<'a> Debug for OnboardMethod<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Send for OnboardMethod<'a>

§

impl<'a> !Sync for OnboardMethod<'a>

§

impl<'a> Freeze for OnboardMethod<'a>

§

impl<'a> RefUnwindSafe for OnboardMethod<'a>

§

impl<'a> Unpin for OnboardMethod<'a>

§

impl<'a> UnsafeUnpin for OnboardMethod<'a>

§

impl<'a> UnwindSafe for OnboardMethod<'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> 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.