[][src]Struct libp2prs_noise::NoiseConfig

pub struct NoiseConfig<P, C: Zeroize> { /* fields omitted */ }

The protocol upgrade configuration.

Implementations

impl<C> NoiseConfig<XX, C> where
    C: Protocol<C> + Zeroize + AsRef<[u8]>, 
[src]

pub fn xx(dh_keys: AuthenticKeypair<C>, local_priv_key: Keypair) -> Self[src]

Create a new NoiseConfig for the XX handshake pattern.

pub async fn handshake<T>(
    self,
    socket: T,
    initiator: bool
) -> Result<(RemoteIdentity<C>, NoiseOutput<T>), NoiseError> where
    T: SplittableReadWrite
[src]

Performs a handshake on the given socket.

This function use initiator to identify server/client.

On success, returns an object that implements the WriteEx and ReadEx trait.

Trait Implementations

impl<P: Clone, C: Clone + Zeroize> Clone for NoiseConfig<P, C>[src]

impl UpgradeInfo for NoiseConfig<XX, X25519>[src]

type Info = &'static [u8]

Opaque type representing a negotiable protocol.

impl UpgradeInfo for NoiseConfig<XX, X25519Spec>[src]

type Info = &'static [u8]

Opaque type representing a negotiable protocol.

impl<T, C> Upgrader<T> for NoiseConfig<XX, C> where
    NoiseConfig<XX, C>: UpgradeInfo,
    T: ConnectionInfo + SplittableReadWrite,
    C: Protocol<C> + Zeroize + AsRef<[u8]> + Clone + Send
[src]

type Output = NoiseOutput<T>

Output after the upgrade has been successfully negotiated and the handshake performed.

Auto Trait Implementations

impl<P, C> RefUnwindSafe for NoiseConfig<P, C> where
    C: RefUnwindSafe,
    P: RefUnwindSafe
[src]

impl<P, C> Send for NoiseConfig<P, C> where
    C: Send,
    P: Send
[src]

impl<P, C> Sync for NoiseConfig<P, C> where
    C: Sync,
    P: Sync
[src]

impl<P, C> Unpin for NoiseConfig<P, C> where
    C: Unpin,
    P: Unpin
[src]

impl<P, C> UnwindSafe for NoiseConfig<P, C> where
    C: UnwindSafe,
    P: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,