pub struct WscallClient { /* private fields */ }Expand description
Main async client type used to connect to a WSCALL server.
Implementations§
Source§impl WscallClient
impl WscallClient
pub async fn connect(url: &str) -> Result<Self, ClientError>
pub async fn connect_with_chacha20( url: &str, key: [u8; 32], ) -> Result<Self, ClientError>
pub async fn connect_with_aes256( url: &str, key: [u8; 32], ) -> Result<Self, ClientError>
pub fn is_connected(&self) -> bool
pub async fn on_event<F, Fut>(&self, name: impl Into<String>, handler: F)
pub async fn on_connected<F, Fut>(&self, handler: F)
pub async fn on_disconnected<F, Fut>(&self, handler: F)
pub async fn call( &self, route: impl Into<String>, params: Value, attachments: Vec<FileAttachment>, ) -> Result<Value, ClientError>
pub async fn send_event( &self, name: impl Into<String>, data: Value, attachments: Vec<FileAttachment>, ) -> Result<Value, ClientError>
pub async fn close(&self) -> Result<(), ClientError>
Trait Implementations§
Source§impl Clone for WscallClient
impl Clone for WscallClient
Source§fn clone(&self) -> WscallClient
fn clone(&self) -> WscallClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WscallClient
impl !RefUnwindSafe for WscallClient
impl Send for WscallClient
impl Sync for WscallClient
impl Unpin for WscallClient
impl UnsafeUnpin for WscallClient
impl !UnwindSafe for WscallClient
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