pub struct PairingAsk { /* private fields */ }Expand description
A request for a pairing and the pair it asks with.
Implementations§
Source§impl PairingAsk
impl PairingAsk
Sourcepub fn new(
code: &PairingCode,
device: DeviceId,
device_name: &str,
) -> Result<Self, SyncError>
pub fn new( code: &PairingCode, device: DeviceId, device_name: &str, ) -> Result<Self, SyncError>
A request for the pairing code shows, from the installation
device, with a pair made here for the handover to be sealed to.
Sourcepub fn confirmation(&self) -> ConfirmationNumber
pub fn confirmation(&self) -> ConfirmationNumber
The number the person compares on the showing device before approving.
Sourcepub fn open_at(&self, now: SystemTime) -> bool
pub fn open_at(&self, now: SystemTime) -> bool
Whether the pairing still lets a first request be sent at now.
Sourcepub async fn publish(&self, storage: &dyn Storage) -> Result<bool, SyncError>
pub async fn publish(&self, storage: &dyn Storage) -> Result<bool, SyncError>
Send the request. false, sending nothing, when the pairing has
ended already: the showing device is gone for good, or its marker holds
the path. A path taken by anything else fails with InvitationChanged.
Sourcepub async fn check(
&self,
storage: &dyn Storage,
now: SystemTime,
) -> Result<PairingCheck, SyncError>
pub async fn check( &self, storage: &dyn Storage, now: SystemTime, ) -> Result<PairingCheck, SyncError>
Look at the request’s path at now. The showing device’s gone marker
ends the pairing whatever the path holds. Otherwise the handover
wins, a request waits and the marker ends it; and nothing, because the
showing device is between its delete and its create or this device’s
own create never arrived, is answered by sending the same request
again while the pairing is open, and ends the pairing once it is not.
Auto Trait Implementations§
impl Freeze for PairingAsk
impl RefUnwindSafe for PairingAsk
impl Send for PairingAsk
impl Sync for PairingAsk
impl Unpin for PairingAsk
impl UnsafeUnpin for PairingAsk
impl UnwindSafe for PairingAsk
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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 more