Struct libp2p_pnet::PnetConfig
source · pub struct PnetConfig { /* private fields */ }
Expand description
Private network configuration
Implementations§
source§impl PnetConfig
impl PnetConfig
pub fn new(key: PreSharedKey) -> Self
sourcepub async fn handshake<TSocket>(
self,
socket: TSocket
) -> Result<PnetOutput<TSocket>, PnetError>where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
pub async fn handshake<TSocket>( self, socket: TSocket ) -> Result<PnetOutput<TSocket>, PnetError>where TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
upgrade a connection to use pre shared key encryption.
the upgrade works by both sides exchanging 24 byte nonces and then encrypting subsequent traffic with XSalsa20
Trait Implementations§
source§impl Clone for PnetConfig
impl Clone for PnetConfig
source§fn clone(&self) -> PnetConfig
fn clone(&self) -> PnetConfig
Returns a copy 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 more