pub struct OfferPairing<'a> { /* private fields */ }Available on crate feature
pairing only.Expand description
Offer is the device that is authenticated and can authorize the new device.
Implementations§
Source§impl<'a> OfferPairing<'a>
impl<'a> OfferPairing<'a>
Sourcepub async fn new(
account: &'a mut NetworkAccount,
url: Url,
) -> Result<(OfferPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
pub async fn new( account: &'a mut NetworkAccount, url: Url, ) -> Result<(OfferPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
Create a new pairing offer.
Sourcepub async fn new_inverted(
account: &'a mut NetworkAccount,
share_url: ServerPairUrl,
) -> Result<(OfferPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
pub async fn new_inverted( account: &'a mut NetworkAccount, share_url: ServerPairUrl, ) -> Result<(OfferPairing<'a>, SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>)>
Create a new pairing offer from a share URL generated by the accepting device.
URL that can be shared with the other device.
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.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Determine if the protocol has completed.
Auto Trait Implementations§
impl<'a> !Freeze for OfferPairing<'a>
impl<'a> !RefUnwindSafe for OfferPairing<'a>
impl<'a> Send for OfferPairing<'a>
impl<'a> Sync for OfferPairing<'a>
impl<'a> Unpin for OfferPairing<'a>
impl<'a> !UnwindSafe for OfferPairing<'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