pub struct RpcClient {
pub request_id: Arc<AtomicU32>,
/* private fields */
}Fields§
§request_id: Arc<AtomicU32>Implementations§
Source§impl RpcClient
impl RpcClient
pub fn new(sender: Sender<SendPacket>) -> Self
Sourcepub async fn report(
&self,
business_id: &impl ToBusinessId,
data: impl Into<Vec<u8>>,
) -> Result<(), SendError>
pub async fn report( &self, business_id: &impl ToBusinessId, data: impl Into<Vec<u8>>, ) -> Result<(), SendError>
Send a request without waiting for a response.
Sourcepub async fn send<T>(
&self,
business_id: &impl ToBusinessId,
data: impl Into<Vec<u8>>,
timeout: Duration,
) -> Result<T, SendError>where
T: FromBytes,
pub async fn send<T>(
&self,
business_id: &impl ToBusinessId,
data: impl Into<Vec<u8>>,
timeout: Duration,
) -> Result<T, SendError>where
T: FromBytes,
Send a request and wait for a response.
Sourcepub async fn send_stream<T>(
&self,
business_id: &impl ToBusinessId,
data: impl Into<Vec<u8>>,
) -> Result<Stream<T>, SendError>
pub async fn send_stream<T>( &self, business_id: &impl ToBusinessId, data: impl Into<Vec<u8>>, ) -> Result<Stream<T>, SendError>
Send a request and receive a stream of responses.
Auto Trait Implementations§
impl Freeze for RpcClient
impl RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl UnsafeUnpin 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