pub struct Config {
pub max_history_len: usize,
pub max_line_len: usize,
pub multiline_mode: bool,
pub terminal_mode: TerminalMode,
pub column_width: ColumnWidth,
pub term_name: Option<String>,
}Expand description
Configuration settings for an Editor instance.
Fields§
§max_history_len: usizeMaximum number of history entries to keep in memory.
max_line_len: usizeMaximum line length in bytes.
multiline_mode: boolEnable multi-line editing mode.
terminal_mode: TerminalModeMode for TTY terminal detection.
column_width: ColumnWidthMode for determining column width.
term_name: Option<String>Explicit terminal name override (or None to check TERM env var).
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_terminal_mode(self, mode: TerminalMode) -> Self
pub fn with_terminal_mode(self, mode: TerminalMode) -> Self
Sets the terminal detection mode.
Sourcepub fn with_column_width(self, column_width: ColumnWidth) -> Self
pub fn with_column_width(self, column_width: ColumnWidth) -> Self
Sets the column width determination mode.
Sourcepub fn with_term_name(self, name: Option<impl Into<String>>) -> Self
pub fn with_term_name(self, name: Option<impl Into<String>>) -> Self
Sets an explicit terminal name override.
Sourcepub fn resolve_terminal_capability(&self) -> TerminalCapability
pub fn resolve_terminal_capability(&self) -> TerminalCapability
Resolves this configuration specification into a TerminalCapability level.
Sourcepub fn resolve_operating_mode(
&self,
is_terminal: impl FnOnce() -> bool,
) -> OperatingMode
pub fn resolve_operating_mode( &self, is_terminal: impl FnOnce() -> bool, ) -> OperatingMode
Resolves this configuration specification into a concrete OperatingMode for the editor.
is_terminal is invoked only when self.terminal_mode == TerminalMode::Auto to resolve
whether the input stream is a TTY.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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