Struct libp2p_noise::Config
source · pub struct Config { /* private fields */ }
Expand description
The configuration for the noise handshake.
Implementations§
source§impl Config
impl Config
sourcepub fn new(identity: &Keypair) -> Result<Self, Error>
pub fn new(identity: &Keypair) -> Result<Self, Error>
Construct a new configuration for the noise handshake using the XX handshake pattern.
sourcepub fn with_prologue(self, prologue: Vec<u8>) -> Self
pub fn with_prologue(self, prologue: Vec<u8>) -> Self
Set the noise prologue.
sourcepub fn with_webtransport_certhashes(
self,
certhashes: HashSet<Multihash<64>>,
) -> Self
pub fn with_webtransport_certhashes( self, certhashes: HashSet<Multihash<64>>, ) -> Self
Set WebTransport certhashes extension.
In case of initiator, these certhashes will be used to validate the ones reported by responder.
In case of responder, these certhashes will be reported to initiator.
Trait Implementations§
source§impl<T> InboundConnectionUpgrade<T> for Config
impl<T> InboundConnectionUpgrade<T> for Config
§type Output = (PeerId, Output<T>)
type Output = (PeerId, Output<T>)
Output after the upgrade has been successfully negotiated and the handshake performed.
source§impl<T> OutboundConnectionUpgrade<T> for Config
impl<T> OutboundConnectionUpgrade<T> for Config
§type Output = (PeerId, Output<T>)
type Output = (PeerId, Output<T>)
Output after the upgrade has been successfully negotiated and the handshake performed.
source§impl UpgradeInfo for Config
impl UpgradeInfo for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more