pub struct RpcClient { /* private fields */ }Implementations§
Source§impl RpcClient
impl RpcClient
Sourcepub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> Self
pub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> Self
creates RPC client with the specified handlers and the default options
Sourcepub fn new0(client: impl AsyncClient + 'static) -> Self
pub fn new0(client: impl AsyncClient + 'static) -> Self
creates RPC client with dummy handlers and the default options
Sourcepub fn create<H>(
client: impl AsyncClient + 'static,
handlers: H,
opts: Options,
) -> Self
pub fn create<H>( client: impl AsyncClient + 'static, handlers: H, opts: Options, ) -> Self
creates RPC client
Sourcepub fn create0(client: impl AsyncClient + 'static, opts: Options) -> Self
pub fn create0(client: impl AsyncClient + 'static, opts: Options) -> Self
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>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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<OpConfirm, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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<OpConfirm, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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<OpConfirm, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Call the method, no response is required
fn is_connected(&self) -> bool
Auto Trait Implementations§
impl !Freeze for RpcClient
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