pub struct InteractionMode {
pub local_echo: bool,
pub crlf: bool,
pub buffer_size: usize,
pub read_timeout: Duration,
pub exit_char: Option<u8>,
pub escape_char: Option<u8>,
}Expand description
Interaction mode configuration.
Fields§
§local_echo: boolWhether to echo input locally.
crlf: boolWhether to translate CR to CRLF.
buffer_size: usizeInput buffer size.
read_timeout: DurationRead timeout.
exit_char: Option<u8>Exit character (e.g., Ctrl+]).
escape_char: Option<u8>Escape character for commands.
Implementations§
Source§impl InteractionMode
impl InteractionMode
Sourcepub const fn with_local_echo(self, echo: bool) -> Self
pub const fn with_local_echo(self, echo: bool) -> Self
Enable local echo.
Sourcepub const fn with_buffer_size(self, size: usize) -> Self
pub const fn with_buffer_size(self, size: usize) -> Self
Set buffer size.
Sourcepub const fn with_read_timeout(self, timeout: Duration) -> Self
pub const fn with_read_timeout(self, timeout: Duration) -> Self
Set read timeout.
Sourcepub const fn with_exit_char(self, ch: Option<u8>) -> Self
pub const fn with_exit_char(self, ch: Option<u8>) -> Self
Set exit character.
Sourcepub const fn with_escape_char(self, ch: Option<u8>) -> Self
pub const fn with_escape_char(self, ch: Option<u8>) -> Self
Set escape character.
Sourcepub fn is_exit_char(&self, ch: u8) -> bool
pub fn is_exit_char(&self, ch: u8) -> bool
Check if a character is the exit character.
Sourcepub fn is_escape_char(&self, ch: u8) -> bool
pub fn is_escape_char(&self, ch: u8) -> bool
Check if a character is the escape character.
Trait Implementations§
Source§impl Clone for InteractionMode
impl Clone for InteractionMode
Source§fn clone(&self) -> InteractionMode
fn clone(&self) -> InteractionMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InteractionMode
impl Debug for InteractionMode
Auto Trait Implementations§
impl Freeze for InteractionMode
impl RefUnwindSafe for InteractionMode
impl Send for InteractionMode
impl Sync for InteractionMode
impl Unpin for InteractionMode
impl UnwindSafe for InteractionMode
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