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) -> PnetConfig
sourcepub async fn handshake<TSocket>(
self,
socket: TSocket
) -> impl Future<Output = Result<PnetOutput<TSocket>, PnetError>>where
TSocket: 'static + AsyncRead + AsyncWrite + Send + Unpin,
pub async fn handshake<TSocket>(
self,
socket: TSocket
) -> impl Future<Output = Result<PnetOutput<TSocket>, PnetError>>where
TSocket: 'static + AsyncRead + AsyncWrite + Send + Unpin,
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