[−][src]Struct libp2p_rpc::RPC
Methods
impl<P: RPCProtocol, TSubstream> RPC<P, TSubstream>
[src]
pub fn new() -> Self
[src]
pub fn send_rpc(
&mut self,
peer_id: PeerId,
rpc_event: RPCEvent<P::Request, P::Response>
)
[src]
&mut self,
peer_id: PeerId,
rpc_event: RPCEvent<P::Request, P::Response>
)
Submits an RPC request.
The peer must be connected for this to succeed.
Trait Implementations
impl<P, TSubstream> NetworkBehaviour for RPC<P, TSubstream> where
P: RPCProtocol + Default + Clone,
TSubstream: AsyncRead + AsyncWrite,
[src]
P: RPCProtocol + Default + Clone,
TSubstream: AsyncRead + AsyncWrite,
type ProtocolsHandler = RPCHandler<P, TSubstream>
Handler for all the protocols the network behaviour supports.
type OutEvent = RPCMessage<P::Request, P::Response>
Event generated by the NetworkBehaviour
and that the swarm will report back.
fn new_handler(&mut self) -> Self::ProtocolsHandler
[src]
fn addresses_of_peer(&mut self, _peer_id: &PeerId) -> Vec<Multiaddr>
[src]
fn inject_connected(&mut self, peer_id: PeerId, connected_point: ConnectedPoint)
[src]
fn inject_disconnected(&mut self, peer_id: &PeerId, _: ConnectedPoint)
[src]
fn inject_node_event(
&mut self,
source: PeerId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent
)
[src]
&mut self,
source: PeerId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent
)
fn poll(
&mut self,
_: &mut impl PollParameters
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
[src]
&mut self,
_: &mut impl PollParameters
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
fn inject_replaced(
&mut self,
peer_id: PeerId,
closed_endpoint: ConnectedPoint,
new_endpoint: ConnectedPoint
)
&mut self,
peer_id: PeerId,
closed_endpoint: ConnectedPoint,
new_endpoint: ConnectedPoint
)
fn inject_addr_reach_failure(
&mut self,
_peer_id: Option<&PeerId>,
_addr: &Multiaddr,
_error: &dyn Error
)
&mut self,
_peer_id: Option<&PeerId>,
_addr: &Multiaddr,
_error: &dyn Error
)
fn inject_dial_failure(&mut self, _peer_id: &PeerId)
fn inject_new_listen_addr(&mut self, _addr: &Multiaddr)
fn inject_expired_listen_addr(&mut self, _addr: &Multiaddr)
fn inject_new_external_addr(&mut self, _addr: &Multiaddr)
fn inject_listener_error(
&mut self,
_id: ListenerId,
_err: &(dyn Error + 'static)
)
&mut self,
_id: ListenerId,
_err: &(dyn Error + 'static)
)
fn inject_listener_closed(&mut self, _id: ListenerId)
Auto Trait Implementations
impl<P, TSubstream> Unpin for RPC<P, TSubstream> where
TSubstream: Unpin,
<P as RPCProtocol>::Request: Unpin,
<P as RPCProtocol>::Response: Unpin,
TSubstream: Unpin,
<P as RPCProtocol>::Request: Unpin,
<P as RPCProtocol>::Response: Unpin,
impl<P, TSubstream> Sync for RPC<P, TSubstream> where
TSubstream: Sync,
<P as RPCProtocol>::Request: Sync,
<P as RPCProtocol>::Response: Sync,
TSubstream: Sync,
<P as RPCProtocol>::Request: Sync,
<P as RPCProtocol>::Response: Sync,
impl<P, TSubstream> Send for RPC<P, TSubstream> where
TSubstream: Send,
<P as RPCProtocol>::Request: Send,
<P as RPCProtocol>::Response: Send,
TSubstream: Send,
<P as RPCProtocol>::Request: Send,
<P as RPCProtocol>::Response: Send,
impl<P, TSubstream> UnwindSafe for RPC<P, TSubstream> where
TSubstream: UnwindSafe,
<P as RPCProtocol>::Request: UnwindSafe,
<P as RPCProtocol>::Response: UnwindSafe,
TSubstream: UnwindSafe,
<P as RPCProtocol>::Request: UnwindSafe,
<P as RPCProtocol>::Response: UnwindSafe,
impl<P, TSubstream> RefUnwindSafe for RPC<P, TSubstream> where
TSubstream: RefUnwindSafe,
<P as RPCProtocol>::Request: RefUnwindSafe,
<P as RPCProtocol>::Response: RefUnwindSafe,
TSubstream: RefUnwindSafe,
<P as RPCProtocol>::Request: RefUnwindSafe,
<P as RPCProtocol>::Response: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self