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
Source§type Output = (PeerId, Output<T>)
type Output = (PeerId, Output<T>)
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Future = Pin<Box<dyn Future<Output = Result<<Config as InboundConnectionUpgrade<T>>::Output, <Config as InboundConnectionUpgrade<T>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<Config as InboundConnectionUpgrade<T>>::Output, <Config as InboundConnectionUpgrade<T>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§fn upgrade_inbound(self, socket: T, _: Self::Info) -> Self::Future
fn upgrade_inbound(self, socket: T, _: Self::Info) -> Self::Future
After we have determined that the remote supports one of the protocols we support, this
method is called to start the handshake. Read more
Source§impl<T> OutboundConnectionUpgrade<T> for Config
impl<T> OutboundConnectionUpgrade<T> for Config
Source§type Output = (PeerId, Output<T>)
type Output = (PeerId, Output<T>)
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Future = Pin<Box<dyn Future<Output = Result<<Config as OutboundConnectionUpgrade<T>>::Output, <Config as OutboundConnectionUpgrade<T>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<Config as OutboundConnectionUpgrade<T>>::Output, <Config as OutboundConnectionUpgrade<T>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§fn upgrade_outbound(self, socket: T, _: Self::Info) -> Self::Future
fn upgrade_outbound(self, socket: T, _: Self::Info) -> Self::Future
After we have determined that the remote supports one of the protocols we support, this
method is called to start the handshake. Read more
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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