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 Freeze for PnetConfig
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)