Struct rpc_core_net::tcp_client::TcpClient
source · pub struct TcpClient { /* private fields */ }
Implementations§
source§impl TcpClient
impl TcpClient
pub fn new(config: TcpConfig) -> Box<Self>
pub fn downgrade(&self) -> WeakPtrSync<Self>
pub fn open(&mut self, host: impl ToString, port: u16)
pub fn close(&mut self)
pub fn set_reconnect(&mut self, ms: u32)
pub fn cancel_reconnect(&mut self)
pub fn stop(&mut self)
pub fn on_open<F>(&mut self, callback: F)where F: Fn() + 'static,
pub fn on_open_failed<F>(&mut self, callback: F)where F: Fn(&dyn Error) + 'static,
pub fn on_data<F>(&mut self, callback: F)where F: Fn(Vec<u8>) + 'static,
pub fn on_close<F>(&mut self, callback: F)where F: Fn() + 'static,
pub fn send(&mut self, data: Vec<u8>)
pub fn send_str(&mut self, data: impl ToString)
Trait Implementations§
Auto Trait Implementations§
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