Struct adnl::AdnlHandshake
source · pub struct AdnlHandshake<P: AdnlPublicKey> { /* private fields */ }
Expand description
Handshake packet, must be sent from client to server prior to any datagrams
Implementations§
source§impl<P: AdnlPublicKey> AdnlHandshake<P>
impl<P: AdnlPublicKey> AdnlHandshake<P>
sourcepub fn new(
receiver: AdnlAddress,
sender: P,
secret: AdnlSecret,
aes_params: AdnlAesParams
) -> Self
pub fn new( receiver: AdnlAddress, sender: P, secret: AdnlSecret, aes_params: AdnlAesParams ) -> Self
Create handshake with given sender and receiver, who already agreed on given secret, also use given session parameters
sourcepub fn aes_params(&self) -> &AdnlAesParams
pub fn aes_params(&self) -> &AdnlAesParams
Get session AES parameters
sourcepub async fn perform_handshake<T: AsyncReadExt + AsyncWriteExt + Unpin>(
&self,
transport: T
) -> Result<AdnlClient<T>, AdnlError>
pub async fn perform_handshake<T: AsyncReadExt + AsyncWriteExt + Unpin>( &self, transport: T ) -> Result<AdnlClient<T>, AdnlError>
Send handshake over the given transport, build AdnlClient
on top of it
Auto Trait Implementations§
impl<P> RefUnwindSafe for AdnlHandshake<P>where
P: RefUnwindSafe,
impl<P> Send for AdnlHandshake<P>where
P: Send,
impl<P> Sync for AdnlHandshake<P>where
P: Sync,
impl<P> Unpin for AdnlHandshake<P>where
P: Unpin,
impl<P> UnwindSafe for AdnlHandshake<P>where
P: UnwindSafe,
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