pub struct RpcClient { /* private fields */ }Available on crate feature
rpc only.Implementations
sourceimpl RpcClient
impl RpcClient
sourcepub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> Self where
H: RpcHandlers + Send + Sync + 'static,
pub fn new<H>(client: impl AsyncClient + 'static, handlers: H) -> Self where
H: RpcHandlers + Send + Sync + 'static,
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 where
H: RpcHandlers + Send + Sync + 'static,
pub fn create<H>(
client: impl AsyncClient + 'static,
handlers: H,
opts: Options
) -> Self where
H: RpcHandlers + Send + Sync + 'static,
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
sourceimpl Rpc for RpcClient
impl Rpc for RpcClient
sourcefn 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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Available on crate feature rpc only.
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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
rpc only.Panics
Will panic on poisoned mutex
sourcefn client(&self) -> Arc<Mutex<dyn AsyncClient + 'static>>
fn client(&self) -> Arc<Mutex<dyn AsyncClient + 'static>>
Available on crate feature
rpc only.When created, elbus client is wrapped with Arc<Mutex<_>> to let it be sent into the incoming frames handler future Read more
sourcefn 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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Available on crate feature
rpc only.sourcefn 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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Available on crate feature
rpc only.Call the method, no response is required
sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Available on crate feature
rpc only.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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more