[][src]Struct libp2p_rpc::RPC

pub struct RPC<P: RPCProtocol, TSubstream> { /* fields omitted */ }

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]

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]

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.

Auto Trait Implementations

impl<P, TSubstream> Unpin for RPC<P, TSubstream> where
    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

impl<P, TSubstream> Send for RPC<P, TSubstream> where
    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

impl<P, TSubstream> RefUnwindSafe for RPC<P, TSubstream> where
    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]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T

impl<T> Erased for T