Struct sc_network::bitswap::Bitswap [−][src]
pub struct Bitswap<B> { /* fields omitted */ }
Expand description
Network behaviour that handles sending and receiving IPFS blocks.
Implementations
Trait Implementations
type ProtocolsHandler = OneShotHandler<BitswapConfig, BitswapMessage, HandlerEvent>
type ProtocolsHandler = OneShotHandler<BitswapConfig, BitswapMessage, HandlerEvent>
Handler for all the protocols the network behaviour supports.
type OutEvent = Void
type OutEvent = Void
Event generated by the NetworkBehaviour
and that the swarm will report back.
Creates a new ProtocolsHandler
for a connection with a peer. Read more
Addresses that this behaviour is aware of for this specific peer, and that may allow reaching the peer. Read more
Indicate to the behaviour that we connected to the node with the given peer id. Read more
Indicates to the behaviour that we disconnected from the node with the given peer id. Read more
Informs the behaviour about an event generated by the handler dedicated to the peer identified by peer_id
.
for the behaviour. Read more
Polls for things that swarm should do. Read more
fn inject_connection_established(
&mut self,
&PeerId,
&ConnectionId,
&ConnectedPoint
)
fn inject_connection_established(
&mut self,
&PeerId,
&ConnectionId,
&ConnectedPoint
)
Informs the behaviour about a newly established connection to a peer.
fn inject_connection_closed(&mut self, &PeerId, &ConnectionId, &ConnectedPoint)
fn inject_connection_closed(&mut self, &PeerId, &ConnectionId, &ConnectedPoint)
Informs the behaviour about a closed connection to a peer. Read more
fn inject_address_change(
&mut self,
&PeerId,
&ConnectionId,
_old: &ConnectedPoint,
_new: &ConnectedPoint
)
fn inject_address_change(
&mut self,
&PeerId,
&ConnectionId,
_old: &ConnectedPoint,
_new: &ConnectedPoint
)
Informs the behaviour that the [ConnectedPoint
] of an existing connection has changed.
fn inject_addr_reach_failure(
&mut self,
_peer_id: Option<&PeerId>,
_addr: &Multiaddr,
_error: &dyn Error
)
fn inject_addr_reach_failure(
&mut self,
_peer_id: Option<&PeerId>,
_addr: &Multiaddr,
_error: &dyn Error
)
Indicates to the behaviour that we tried to reach an address, but failed. Read more
fn inject_dial_failure(&mut self, _peer_id: &PeerId)
fn inject_dial_failure(&mut self, _peer_id: &PeerId)
Indicates to the behaviour that we tried to dial all the addresses known for a node, but failed. Read more
fn inject_new_listener(&mut self, _id: ListenerId)
fn inject_new_listener(&mut self, _id: ListenerId)
Indicates to the behaviour that a new listener was created.
fn inject_new_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr)
fn inject_new_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr)
Indicates to the behaviour that we have started listening on a new multiaddr.
fn inject_expired_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr)
fn inject_expired_listen_addr(&mut self, _id: ListenerId, _addr: &Multiaddr)
Indicates to the behaviour that a multiaddr we were listening on has expired, which means that we are no longer listening in it. Read more
fn inject_listener_error(
&mut self,
_id: ListenerId,
_err: &(dyn Error + 'static)
)
fn inject_listener_error(
&mut self,
_id: ListenerId,
_err: &(dyn Error + 'static)
)
A listener experienced an error.
fn inject_listener_closed(
&mut self,
_id: ListenerId,
_reason: Result<(), &Error>
)
fn inject_listener_closed(
&mut self,
_id: ListenerId,
_reason: Result<(), &Error>
)
A listener closed.
fn inject_new_external_addr(&mut self, _addr: &Multiaddr)
fn inject_new_external_addr(&mut self, _addr: &Multiaddr)
Indicates to the behaviour that we have discovered a new external address for us.
fn inject_expired_external_addr(&mut self, _addr: &Multiaddr)
fn inject_expired_external_addr(&mut self, _addr: &Multiaddr)
Indicates to the behaviour that an external address was removed.
Auto Trait Implementations
impl<B> !RefUnwindSafe for Bitswap<B>
impl<B> !UnwindSafe for Bitswap<B>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more