[][src]Struct noise_protocol::patterns::HandshakePattern

pub struct HandshakePattern { /* fields omitted */ }

Noise handshake pattern.

Methods

impl HandshakePattern[src]

pub fn new(
    pre_i: &[Token],
    pre_r: &[Token],
    msg_patterns: &[&[Token]],
    name: &'static str
) -> Self
[src]

Construct a new HandshakePattern from pre-message patterns, message patterns and name.

Pattern validity

It is the caller's responlity to ensure that the pattern is valid.

Panics

If any of the patterns are too long (longer than 8 tokens).

Or if the number of patterns are too large (larger than 8).

pub fn get_pre_i(&self) -> &[Token][src]

Get initiator pre-messages.

pub fn get_pre_r(&self) -> &[Token][src]

Get responder pre-messages.

pub fn get_message_pattern(&self, i: usize) -> &[Token][src]

Get message patterns.

pub fn get_message_patterns_len(&self) -> usize[src]

Get number of message patterns.

pub fn get_name(&self) -> &'static str[src]

Get pattern name.

pub fn has_psk(&self) -> bool[src]

Whether there are any psk tokens in this pattern.

pub fn is_one_way(&self) -> bool[src]

Whether the pattern is a one-way pattern.

Trait Implementations

impl Clone for HandshakePattern[src]

Auto Trait Implementations

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