Skip to main content

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 { ... }
    fn send_paste(
        &mut self,
        text: &str,
    ) -> 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).

Source

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

Send text using bracketed paste mode.

Wraps the content in \x1b[200~ and \x1b[201~ markers. Terminal applications that have enabled bracketed paste (DECSET 2004) treat the enclosed content as pasted input rather than typed input — this suppresses autocomplete, command-history scanning, and per-character interpretation that can otherwise mangle multi-line or special-key content (e.g. a leading / triggering a slash-command popup).

The application must have requested bracketed paste; if it hasn’t, most terminals will ignore the markers and the inner text will be delivered as-is, so the call is safe to use unconditionally.

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§