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) -> PnetConfig
sourcepub async fn handshake<TSocket>(
self,
socket: TSocket
) -> Result<PnetOutput<TSocket>, PnetError> where
TSocket: 'static + AsyncRead + AsyncWrite + Send + Unpin,
pub async fn handshake<TSocket>(
self,
socket: TSocket
) -> 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
sourceimpl Clone for PnetConfig
impl Clone for PnetConfig
sourcepub fn clone(&self) -> PnetConfig
pub fn clone(&self) -> PnetConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more