Trait cbsk_socket_rayon::tcp::common::tcp_write_trait::TcpWriteTrait
source · pub trait TcpWriteTrait {
// Required methods
fn get_log_head(&self) -> &str;
fn try_send_bytes(&self, bytes: &[u8]) -> Result<()>;
// Provided methods
fn send_text(&self, text: &str) { ... }
fn try_send_text(&self, text: &str) -> Result<()> { ... }
fn send_json(&self, json: &(impl Serialize + Sync)) { ... }
fn try_send_json(&self, json: &(impl Serialize + Sync)) -> Result<()> { ... }
fn send_bytes(&self, bytes: &[u8]) { ... }
}
Expand description
tcp write trait
Required Methods§
sourcefn get_log_head(&self) -> &str
fn get_log_head(&self) -> &str
get internal log name
sourcefn try_send_bytes(&self, bytes: &[u8]) -> Result<()>
fn try_send_bytes(&self, bytes: &[u8]) -> Result<()>
try send bytes to TCP
Provided Methods§
sourcefn try_send_text(&self, text: &str) -> Result<()>
fn try_send_text(&self, text: &str) -> Result<()>
try send text to TCP
sourcefn send_bytes(&self, bytes: &[u8])
fn send_bytes(&self, bytes: &[u8])
send bytes to TCP
Object Safety§
This trait is not object safe.
Implementors§
impl TcpWriteTrait for TcpClient
support tcp write trait