Struct PairingBitBox

Source
pub struct PairingBitBox<R: Runtime> { /* private fields */ }
Expand description

BitBox in the pairing state. Use get_pairing_code() to display the pairing code to the user and wait_confirm() to proceed to the paired state.

Implementations§

Source§

impl<R: Runtime> PairingBitBox<R>

Source

pub fn get_pairing_code(&self) -> Option<String>

If a pairing code confirmation is required, this returns the pairing code. You must display it to the user and then call wait_confirm() to wait until the user confirms the code on the BitBox.

If the BitBox was paired before and the pairing was persisted, the pairing step is skipped. In this case, None is returned. Also in this case, call wait_confirm() to establish the encrypted connection.

Source

pub async fn wait_confirm(self) -> Result<PairedBitBox<R>, Error>

Proceed to the paired state.

Auto Trait Implementations§

§

impl<R> Freeze for PairingBitBox<R>

§

impl<R> !RefUnwindSafe for PairingBitBox<R>

§

impl<R> !Send for PairingBitBox<R>

§

impl<R> !Sync for PairingBitBox<R>

§

impl<R> Unpin for PairingBitBox<R>
where R: Unpin,

§

impl<R> !UnwindSafe for PairingBitBox<R>

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.