Struct libp2p_pnet::PnetConfig
source · [−]pub struct PnetConfig { /* private fields */ }Expand description
Private network configuration
Implementations
sourceimpl 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
sourceimpl Clone for PnetConfig
impl Clone for PnetConfig
sourcefn clone(&self) -> PnetConfig
fn clone(&self) -> PnetConfig
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more