Struct libp2prs_noise::NoiseConfig[][src]

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

The protocol upgrade configuration.

Implementations

impl<H, C: Zeroize, R> NoiseConfig<H, C, R>[src]

pub fn set_legacy_config(&mut self, cfg: LegacyConfig) -> &mut Self[src]

Sets the legacy configuration options to use, if any.

impl<C> NoiseConfig<XX, C> where
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static, 
[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: AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

Trait Implementations

impl<P: Clone, C: Clone + Zeroize, R: Clone> Clone for NoiseConfig<P, C, R>[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
    Self: UpgradeInfo,
    T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Clone + Send + 'static, 
[src]

type Output = NoiseStream<T>

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

Auto Trait Implementations

impl<P, C, R> RefUnwindSafe for NoiseConfig<P, C, R> where
    C: RefUnwindSafe,
    P: RefUnwindSafe,
    R: RefUnwindSafe

impl<P, C, R> Send for NoiseConfig<P, C, R> where
    C: Send,
    P: Send,
    R: Send

impl<P, C, R> Sync for NoiseConfig<P, C, R> where
    C: Sync,
    P: Sync,
    R: Sync

impl<P, C, R> Unpin for NoiseConfig<P, C, R> where
    C: Unpin,
    P: Unpin,
    R: Unpin

impl<P, C, R> UnwindSafe for NoiseConfig<P, C, R> where
    C: UnwindSafe,
    P: UnwindSafe,
    R: UnwindSafe

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>,