pub struct DevicePairingHost { /* private fields */ }Expand description
A listener behind the one QR code shown by the existing device. It accepts one exact signed identity, survives client reconnects, and returns the same sealed invitation on every retry.
Implementations§
Source§impl DevicePairingHost
impl DevicePairingHost
pub async fn start( listener: TcpListener, offer: DevicePairingOffer, pairing_key: UserKeypair, journal_path: PathBuf, clock: ClockRef, ) -> Result<Self, DevicePairingTransportError>
pub async fn resume( listener: TcpListener, journal_path: PathBuf, clock: ClockRef, ) -> Result<Self, DevicePairingTransportError>
pub async fn start_or_resume( listener: TcpListener, offer: DevicePairingOffer, pairing_key: UserKeypair, journal_path: PathBuf, clock: ClockRef, ) -> Result<Self, DevicePairingTransportError>
pub fn offer(&self) -> &DevicePairingOffer
pub fn subscribe_request(&self) -> Receiver<Option<DevicePairingRequest>>
pub async fn wait_for_request( &self, ) -> Result<DevicePairingRequest, DevicePairingTransportError>
pub fn deliver_invitation( &self, request: &DevicePairingRequest, invitation: Vec<u8>, ) -> Result<(), DevicePairingTransportError>
pub fn invitation( &self, request: &DevicePairingRequest, ) -> Result<Option<Vec<u8>>, DevicePairingTransportError>
Sourcepub fn cancellation_invitation(
&self,
request: &DevicePairingRequest,
) -> Result<Option<Vec<u8>>, DevicePairingTransportError>
pub fn cancellation_invitation( &self, request: &DevicePairingRequest, ) -> Result<Option<Vec<u8>>, DevicePairingTransportError>
Return the exact Store attempt retained by a durable cancellation so a restarted owner can finish its signed unwind instead of approving it.
Sourcepub fn cancel(&self) -> Result<Option<Vec<u8>>, DevicePairingTransportError>
pub fn cancel(&self) -> Result<Option<Vec<u8>>, DevicePairingTransportError>
Persist cancellation and return the delivered invitation, when one exists, so the owner can unwind the exact Store attempt it started.
pub fn finish(&self) -> Result<(), DevicePairingTransportError>
Trait Implementations§
Source§impl Clone for DevicePairingHost
impl Clone for DevicePairingHost
Source§fn clone(&self) -> DevicePairingHost
fn clone(&self) -> DevicePairingHost
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DevicePairingHost
impl !RefUnwindSafe for DevicePairingHost
impl Send for DevicePairingHost
impl Sync for DevicePairingHost
impl Unpin for DevicePairingHost
impl UnsafeUnpin for DevicePairingHost
impl !UnwindSafe for DevicePairingHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.