pub struct RpcClient { /* private fields */ }Implementations§
source§impl RpcClient
impl RpcClient
sourcepub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> RpcClientwhere
H: RpcHandlers + Send + Sync + 'static,
pub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> RpcClientwhere H: RpcHandlers + Send + Sync + 'static,
creates RPC client with the specified handlers and the default options
sourcepub fn new0(client: impl AsyncClient + 'static) -> RpcClient
pub fn new0(client: impl AsyncClient + 'static) -> RpcClient
creates RPC client with dummy handlers and the default options
sourcepub fn create<H>(
client: impl AsyncClient + 'static,
handlers: H,
opts: Options
) -> RpcClientwhere
H: RpcHandlers + Send + Sync + 'static,
pub fn create<H>( client: impl AsyncClient + 'static, handlers: H, opts: Options ) -> RpcClientwhere H: RpcHandlers + Send + Sync + 'static,
creates RPC client
sourcepub fn create0(client: impl AsyncClient + 'static, opts: Options) -> RpcClient
pub fn create0(client: impl AsyncClient + 'static, opts: Options) -> RpcClient
creates RPC client with dummy handlers
Trait Implementations§
source§impl Rpc for RpcClient
impl Rpc for RpcClient
source§fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 str,
method: &'life2 str,
params: Cow<'async_trait>,
qos: QoS
) -> Pin<Box<dyn Future<Output = Result<RpcEvent, RpcError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
RpcClient: 'async_trait,
fn call<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target: &'life1 str, method: &'life2 str, params: Cow<'async_trait>, qos: QoS ) -> Pin<Box<dyn Future<Output = Result<RpcEvent, RpcError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, RpcClient: 'async_trait,
Panics
Will panic on poisoned mutex
source§fn client(&self) -> Arc<Mutex<dyn AsyncClient + 'static>>
fn client(&self) -> Arc<Mutex<dyn AsyncClient + 'static>>
When created, busrt client is wrapped with Arc<Mutex<_>> to let it be sent into
the incoming frames handler future Read more
fn notify<'life0, 'life1, 'async_trait>( &'life0 self, target: &'life1 str, data: Cow<'async_trait>, qos: QoS ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, RpcClient: 'async_trait,
source§fn call0<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target: &'life1 str,
method: &'life2 str,
params: Cow<'async_trait>,
qos: QoS
) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
RpcClient: 'async_trait,
fn call0<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target: &'life1 str, method: &'life2 str, params: Cow<'async_trait>, qos: QoS ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, RpcClient: 'async_trait,
Call the method, no response is required
fn is_connected(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
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