pub struct ProtocolConfig { /* private fields */ }Expand description
Implementation of InboundUpgrade and OutboundUpgrade for the Gossipsub protocol.
Implementations§
Source§impl ProtocolConfig
impl ProtocolConfig
Sourcepub fn new(
id_prefix: Cow<'static, str>,
max_transmit_size: usize,
validation_mode: ValidationMode,
support_floodsub: bool,
) -> ProtocolConfig
pub fn new( id_prefix: Cow<'static, str>, max_transmit_size: usize, validation_mode: ValidationMode, support_floodsub: bool, ) -> ProtocolConfig
Builds a new ProtocolConfig.
Sets the maximum gossip transmission size.
Trait Implementations§
Source§impl Clone for ProtocolConfig
impl Clone for ProtocolConfig
Source§fn clone(&self) -> ProtocolConfig
fn clone(&self) -> ProtocolConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfig
impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfig
Source§type Output = (Framed<TSocket, GossipsubCodec>, PeerKind)
type Output = (Framed<TSocket, GossipsubCodec>, PeerKind)
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = GossipsubHandlerError
type Error = GossipsubHandlerError
Possible error during the handshake.
Source§type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as InboundUpgrade<TSocket>>::Output, <ProtocolConfig as InboundUpgrade<TSocket>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as InboundUpgrade<TSocket>>::Output, <ProtocolConfig as InboundUpgrade<TSocket>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§impl<TSocket> OutboundUpgrade<TSocket> for ProtocolConfig
impl<TSocket> OutboundUpgrade<TSocket> for ProtocolConfig
Source§type Output = (Framed<TSocket, GossipsubCodec>, PeerKind)
type Output = (Framed<TSocket, GossipsubCodec>, PeerKind)
Output after the upgrade has been successfully negotiated and the handshake performed.
Source§type Error = GossipsubHandlerError
type Error = GossipsubHandlerError
Possible error during the handshake.
Source§type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as OutboundUpgrade<TSocket>>::Output, <ProtocolConfig as OutboundUpgrade<TSocket>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as OutboundUpgrade<TSocket>>::Output, <ProtocolConfig as OutboundUpgrade<TSocket>>::Error>> + Send>>
Future that performs the handshake with the remote.
Source§impl UpgradeInfo for ProtocolConfig
impl UpgradeInfo for ProtocolConfig
Source§type Info = ProtocolId
type Info = ProtocolId
Opaque type representing a negotiable protocol.
Source§type InfoIter = Vec<<ProtocolConfig as UpgradeInfo>::Info>
type InfoIter = Vec<<ProtocolConfig as UpgradeInfo>::Info>
Iterator returned by
protocol_info.Source§fn protocol_info(&self) -> Self::InfoIter
fn protocol_info(&self) -> Self::InfoIter
Returns the list of protocols that are supported. Used during the negotiation process.
Auto Trait Implementations§
impl Freeze for ProtocolConfig
impl RefUnwindSafe for ProtocolConfig
impl Send for ProtocolConfig
impl Sync for ProtocolConfig
impl Unpin for ProtocolConfig
impl UnwindSafe for ProtocolConfig
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§impl<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
impl<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
Source§fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Output.Source§fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Error.Source§impl<T, TInfo> InboundUpgradeSend for Twhere
T: InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, Info = TInfo> + UpgradeInfoSend<Info = TInfo>,
TInfo: ProtocolName + Clone + Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output: Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error: Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future: Send + 'static,
impl<T, TInfo> InboundUpgradeSend for Twhere
T: InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, Info = TInfo> + UpgradeInfoSend<Info = TInfo>,
TInfo: ProtocolName + Clone + Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output: Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error: Send + 'static,
<T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future: Send + 'static,
Source§type Output = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output
type Output = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output
Equivalent to
InboundUpgrade::Output.Source§type Error = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error
type Error = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error
Equivalent to
InboundUpgrade::Error.Source§type Future = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
type Future = <T as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
Equivalent to
InboundUpgrade::Future.Source§fn upgrade_inbound(
self,
socket: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
info: TInfo,
) -> <T as InboundUpgradeSend>::Future
fn upgrade_inbound( self, socket: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, info: TInfo, ) -> <T as InboundUpgradeSend>::Future
Equivalent to
InboundUpgrade::upgrade_inbound.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 moreSource§impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
Source§fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Output.Source§fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>
Returns a new object that wraps around
Self and applies a closure to the Error.Source§impl<T, TInfo> OutboundUpgradeSend for Twhere
T: OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, Info = TInfo> + UpgradeInfoSend<Info = TInfo>,
TInfo: ProtocolName + Clone + Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output: Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error: Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future: Send + 'static,
impl<T, TInfo> OutboundUpgradeSend for Twhere
T: OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, Info = TInfo> + UpgradeInfoSend<Info = TInfo>,
TInfo: ProtocolName + Clone + Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output: Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error: Send + 'static,
<T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future: Send + 'static,
Source§type Output = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output
type Output = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output
Equivalent to
OutboundUpgrade::Output.Source§type Error = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error
type Error = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error
Equivalent to
OutboundUpgrade::Error.Source§type Future = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
type Future = <T as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
Equivalent to
OutboundUpgrade::Future.Source§fn upgrade_outbound(
self,
socket: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
info: TInfo,
) -> <T as OutboundUpgradeSend>::Future
fn upgrade_outbound( self, socket: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>, info: TInfo, ) -> <T as OutboundUpgradeSend>::Future
Equivalent to
OutboundUpgrade::upgrade_outbound.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,
Source§type Info = <T as UpgradeInfo>::Info
type Info = <T as UpgradeInfo>::Info
Equivalent to
UpgradeInfo::Info.Source§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.