pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(transport: Arc<dyn Transport>, listen_once: bool) -> Self
pub async fn send_sync<Request: Serialize, Response: DeserializeOwned>( &self, event: &str, data: &mut Request, ) -> Result<Response, MsRsError>
pub async fn listen<Request, Response, Fut>( &self, event: &str, f: Box<dyn Fn(Request) -> Fut + Sync + Send + 'static>, ) -> Result<(), MsRsError>
pub async fn send<Request: Serialize>( &self, event: &str, headers: Option<HashMap<String, String>>, data: Request, ) -> Result<(), MsRsError>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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