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> InboundUpgrade<T> for Configwhere
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
impl<T> InboundUpgrade<T> for Configwhere T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
§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> OutboundUpgrade<T> for Configwhere
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
impl<T> OutboundUpgrade<T> for Configwhere T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
§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 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<U, T> InboundConnectionUpgrade<T> for Uwhere
U: InboundUpgrade<T>,
impl<U, T> InboundConnectionUpgrade<T> for Uwhere U: InboundUpgrade<T>,
§type Output = <U as InboundUpgrade<T>>::Output
type Output = <U as InboundUpgrade<T>>::Output
Output after the upgrade has been successfully negotiated and the handshake performed.
§type Error = <U as InboundUpgrade<T>>::Error
type Error = <U as InboundUpgrade<T>>::Error
Possible error during the handshake.
§type Future = <U as InboundUpgrade<T>>::Future
type Future = <U as InboundUpgrade<T>>::Future
Future that performs the handshake with the remote.
source§fn upgrade_inbound(
self,
socket: T,
info: <U as UpgradeInfo>::Info
) -> <U as InboundConnectionUpgrade<T>>::Future
fn upgrade_inbound( self, socket: T, info: <U as UpgradeInfo>::Info ) -> <U 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
§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<U, T> OutboundConnectionUpgrade<T> for Uwhere
U: OutboundUpgrade<T>,
impl<U, T> OutboundConnectionUpgrade<T> for Uwhere U: OutboundUpgrade<T>,
§type Output = <U as OutboundUpgrade<T>>::Output
type Output = <U as OutboundUpgrade<T>>::Output
Output after the upgrade has been successfully negotiated and the handshake performed.
§type Error = <U as OutboundUpgrade<T>>::Error
type Error = <U as OutboundUpgrade<T>>::Error
Possible error during the handshake.
§type Future = <U as OutboundUpgrade<T>>::Future
type Future = <U as OutboundUpgrade<T>>::Future
Future that performs the handshake with the remote.
source§fn upgrade_outbound(
self,
socket: T,
info: <U as UpgradeInfo>::Info
) -> <U as OutboundConnectionUpgrade<T>>::Future
fn upgrade_outbound( self, socket: T, info: <U as UpgradeInfo>::Info ) -> <U 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