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<Config, Error>
pub fn new(identity: &Keypair) -> Result<Config, Error>
Construct a new configuration for the noise handshake using the XX handshake pattern.
sourcepub fn with_prologue(self, prologue: Vec<u8>) -> Config
pub fn with_prologue(self, prologue: Vec<u8>) -> Config
Set the noise prologue.
sourcepub fn with_webtransport_certhashes(
self,
certhashes: HashSet<Multihash<64>>
) -> Config
pub fn with_webtransport_certhashes( self, certhashes: HashSet<Multihash<64>> ) -> Config
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.
§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,
_: <Config as UpgradeInfo>::Info
) -> <Config as InboundConnectionUpgrade<T>>::Future
fn upgrade_inbound( self, socket: T, _: <Config as UpgradeInfo>::Info ) -> <Config as InboundConnectionUpgrade<T>>::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
§type Output = (PeerId, Output<T>)
type Output = (PeerId, Output<T>)
Output after the upgrade has been successfully negotiated and the handshake performed.
§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,
_: <Config as UpgradeInfo>::Info
) -> <Config as OutboundConnectionUpgrade<T>>::Future
fn upgrade_outbound( self, socket: T, _: <Config as UpgradeInfo>::Info ) -> <Config as OutboundConnectionUpgrade<T>>::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 UpgradeInfo for Config
impl UpgradeInfo for Config
source§fn protocol_info(&self) -> <Config as UpgradeInfo>::InfoIter
fn protocol_info(&self) -> <Config as UpgradeInfo>::InfoIter
Returns the list of protocols that are supported. Used during the negotiation process.
Auto Trait Implementations§
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> 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> UpgradeInfoSend for Twhere
T: UpgradeInfo + Send + 'static,
<T as UpgradeInfo>::Info: Send + 'static,
<<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static,
impl<T> UpgradeInfoSend for Twhere
T: UpgradeInfo + Send + 'static,
<T as UpgradeInfo>::Info: Send + 'static,
<<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static,
§type Info = <T as UpgradeInfo>::Info
type Info = <T as UpgradeInfo>::Info
Equivalent to
UpgradeInfo::Info
.§type InfoIter = <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter
type InfoIter = <<T as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter
Equivalent to
UpgradeInfo::InfoIter
.source§fn protocol_info(&self) -> <T as UpgradeInfoSend>::InfoIter
fn protocol_info(&self) -> <T as UpgradeInfoSend>::InfoIter
Equivalent to
UpgradeInfo::protocol_info
.