pub struct ArcClient<C> { /* private fields */ }
Expand description
Wraps a client into an Arc<Mutex<_>>
, so that it can be cloned.
Implementations§
Trait Implementations§
Source§impl<C: Client + Send> Client for ArcClient<C>
impl<C: Client + Send> Client for ArcClient<C>
Source§fn send_request<'life0, 'life1, 'life2, 'async_trait, P, R>(
&'life0 self,
method: &'life1 str,
params: &'life2 P,
) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
fn send_request<'life0, 'life1, 'life2, 'async_trait, P, R>( &'life0 self, method: &'life1 str, params: &'life2 P, ) -> Pin<Box<dyn Future<Output = Result<R, Self::Error>> + Send + 'async_trait>>
Sends a JSON-HTTP request Read more
Source§fn connect_stream<'life0, 'async_trait, T>(
&'life0 self,
id: SubscriptionId,
) -> Pin<Box<dyn Future<Output = BoxStream<'static, T>> + Send + 'async_trait>>where
T: for<'de> Deserialize<'de> + Debug + Send + Sync + 'async_trait + Unpin + 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn connect_stream<'life0, 'async_trait, T>(
&'life0 self,
id: SubscriptionId,
) -> Pin<Box<dyn Future<Output = BoxStream<'static, T>> + Send + 'async_trait>>where
T: for<'de> Deserialize<'de> + Debug + Send + Sync + 'async_trait + Unpin + 'static,
Self: 'async_trait,
'life0: 'async_trait,
If the client supports streams (i.e. receiving notifications), this should return a stream for the specific
subscription ID. Read more
Source§fn disconnect_stream<'life0, 'async_trait>(
&'life0 self,
id: SubscriptionId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect_stream<'life0, 'async_trait>(
&'life0 self,
id: SubscriptionId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
If the client supports streams (i.e. receiving notifications) and there is a matching subscription ID, this
should close the corresponding stream. Read more
Auto Trait Implementations§
impl<C> Freeze for ArcClient<C>
impl<C> !RefUnwindSafe for ArcClient<C>
impl<C> Send for ArcClient<C>where
C: Send,
impl<C> Sync for ArcClient<C>where
C: Send,
impl<C> Unpin for ArcClient<C>
impl<C> !UnwindSafe for ArcClient<C>
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