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>
pub async fn handshake<TSocket>( self, socket: TSocket ) -> Result<PnetOutput<TSocket>, PnetError>
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 moresource§impl Debug for PnetConfig
impl Debug for PnetConfig
impl Copy for PnetConfig
Auto Trait Implementations§
impl RefUnwindSafe for PnetConfig
impl Send for PnetConfig
impl Sync for PnetConfig
impl Unpin for PnetConfig
impl UnwindSafe for PnetConfig
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