pub struct AcceptPairing<'a> { /* private fields */ }Available on crate feature
pairing only.Expand description
Accept is the device being paired.
Implementations§
Source§impl<'a> AcceptPairing<'a>
impl<'a> AcceptPairing<'a>
Sourcepub async fn new(
share_url: ServerPairUrl,
device: &'a DeviceMetaData,
target: BackendTarget,
) -> Result<(AcceptPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
pub async fn new( share_url: ServerPairUrl, device: &'a DeviceMetaData, target: BackendTarget, ) -> Result<(AcceptPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
Create a new pairing connection.
Sourcepub async fn new_inverted(
account_id: AccountId,
server: Url,
device: &'a DeviceMetaData,
target: BackendTarget,
) -> Result<(ServerPairUrl, AcceptPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
pub async fn new_inverted( account_id: AccountId, server: Url, device: &'a DeviceMetaData, target: BackendTarget, ) -> Result<(ServerPairUrl, AcceptPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
Create a new inverted pairing connection.
Sourcepub async fn run(
&mut self,
stream: SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>,
shutdown_rx: Receiver<()>,
) -> Result<()>
pub async fn run( &mut self, stream: SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>, shutdown_rx: Receiver<()>, ) -> Result<()>
Start the event loop and the pairing protocol.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Determine if the protocol has completed.
Sourcepub fn take_enrollment(self) -> Result<DeviceEnrollment>
pub fn take_enrollment(self) -> Result<DeviceEnrollment>
Take the final device enrollment.
Errors if the protocol has not reached completion.
Auto Trait Implementations§
impl<'a> !Freeze for AcceptPairing<'a>
impl<'a> !RefUnwindSafe for AcceptPairing<'a>
impl<'a> Send for AcceptPairing<'a>
impl<'a> Sync for AcceptPairing<'a>
impl<'a> Unpin for AcceptPairing<'a>
impl<'a> !UnwindSafe for AcceptPairing<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more