BasicSend

Trait BasicSend 

Source
pub trait BasicSend: Send {
    // Required method
    fn send_bytes(
        &mut self,
        data: &[u8],
    ) -> impl Future<Output = Result<()>> + Send;

    // Provided methods
    fn send_str(&mut self, s: &str) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_line_with(
        &mut self,
        line: &str,
        ending: LineEnding,
    ) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_line(
        &mut self,
        line: &str,
    ) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_control(
        &mut self,
        ctrl: ControlChar,
    ) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_interrupt(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_eof(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_suspend(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_escape(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_tab(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
    fn send_backspace(&mut self) -> impl Future<Output = Result<()>> + Send { ... }
}
Expand description

Trait for basic send operations.

Required Methods§

Source

fn send_bytes(&mut self, data: &[u8]) -> impl Future<Output = Result<()>> + Send

Send raw bytes.

Provided Methods§

Source

fn send_str(&mut self, s: &str) -> impl Future<Output = Result<()>> + Send

Send a string.

Source

fn send_line_with( &mut self, line: &str, ending: LineEnding, ) -> impl Future<Output = Result<()>> + Send

Send a line with the specified line ending.

Source

fn send_line(&mut self, line: &str) -> impl Future<Output = Result<()>> + Send

Send a line with LF ending.

Source

fn send_control( &mut self, ctrl: ControlChar, ) -> impl Future<Output = Result<()>> + Send

Send a control character.

Source

fn send_interrupt(&mut self) -> impl Future<Output = Result<()>> + Send

Send Ctrl+C (interrupt).

Source

fn send_eof(&mut self) -> impl Future<Output = Result<()>> + Send

Send Ctrl+D (EOF).

Source

fn send_suspend(&mut self) -> impl Future<Output = Result<()>> + Send

Send Ctrl+Z (suspend).

Source

fn send_escape(&mut self) -> impl Future<Output = Result<()>> + Send

Send Escape.

Source

fn send_tab(&mut self) -> impl Future<Output = Result<()>> + Send

Send Tab (Ctrl+I).

Source

fn send_backspace(&mut self) -> impl Future<Output = Result<()>> + Send

Send Backspace (Ctrl+H).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§