pub struct Sender<W> { /* private fields */ }Expand description
A sender that wraps an async writer.
Implementations§
Source§impl<W: AsyncWriteExt + Unpin + Send> Sender<W>
impl<W: AsyncWriteExt + Unpin + Send> Sender<W>
Sourcepub const fn set_line_ending(&mut self, ending: LineEnding)
pub const fn set_line_ending(&mut self, ending: LineEnding)
Set the line ending.
Sourcepub const fn set_char_delay(&mut self, delay: Option<Duration>)
pub const fn set_char_delay(&mut self, delay: Option<Duration>)
Set character delay for slow typing.
Sourcepub const fn line_ending(&self) -> LineEnding
pub const fn line_ending(&self) -> LineEnding
Get the line ending.
Sourcepub async fn send_with_delay(&mut self, data: &[u8]) -> Result<()>
pub async fn send_with_delay(&mut self, data: &[u8]) -> Result<()>
Send bytes with optional character delay.
Sourcepub const fn writer_mut(&mut self) -> &mut W
pub const fn writer_mut(&mut self) -> &mut W
Get mutable access to the underlying writer.
Trait Implementations§
Source§impl<W: AsyncWriteExt + Unpin + Send> BasicSend for Sender<W>
impl<W: AsyncWriteExt + Unpin + Send> BasicSend for Sender<W>
Source§fn send_line_with(
&mut self,
line: &str,
ending: LineEnding,
) -> impl Future<Output = Result<()>> + Send
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_control(
&mut self,
ctrl: ControlChar,
) -> impl Future<Output = Result<()>> + Send
fn send_control( &mut self, ctrl: ControlChar, ) -> impl Future<Output = Result<()>> + Send
Send a control character.
Auto Trait Implementations§
impl<W> Freeze for Sender<W>where
W: Freeze,
impl<W> RefUnwindSafe for Sender<W>where
W: RefUnwindSafe,
impl<W> Send for Sender<W>where
W: Send,
impl<W> Sync for Sender<W>where
W: Sync,
impl<W> Unpin for Sender<W>where
W: Unpin,
impl<W> UnwindSafe for Sender<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> AnsiSend for Twhere
T: BasicSend,
impl<T> AnsiSend for Twhere
T: BasicSend,
Source§fn send_cursor_up(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_cursor_up(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send cursor up.
Source§fn send_cursor_down(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_cursor_down(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send cursor down.
Source§fn send_cursor_right(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_cursor_right(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send cursor right.
Source§fn send_cursor_left(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_cursor_left(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send cursor left.
Source§fn send_home(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_home(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send home key.
Source§fn send_end(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
fn send_end(&mut self) -> impl Future<Output = Result<()>> + Sendwhere
Self: Send,
Send end key.
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