ProgramConfig

Struct ProgramConfig 

Source
pub struct ProgramConfig {
Show 14 fields pub alt_screen: bool, pub mouse_motion: MouseMotion, pub report_focus: bool, pub fps: u32, pub without_renderer: bool, pub catch_panics: bool, pub signal_handler: bool, pub bracketed_paste: bool, pub output_writer: Option<Arc<Mutex<dyn AsyncWrite + Send + Unpin>>>, pub cancellation_token: Option<CancellationToken>, pub input_source: Option<InputSource>, pub event_channel_buffer: Option<usize>, pub memory_monitoring: bool, pub environment: Option<HashMap<String, String>>,
}
Expand description

Configuration options for a Program.

This struct holds various settings that control the behavior of the Program, such as terminal features, rendering options, and panic/signal handling.

Fields§

§alt_screen: bool

Whether to use the alternate screen buffer.

§mouse_motion: MouseMotion

The mouse motion reporting mode.

§report_focus: bool

Whether to report focus events.

§fps: u32

The target frames per second for rendering.

§without_renderer: bool

Whether to disable the renderer entirely.

§catch_panics: bool

Whether to catch panics and convert them into ProgramPanic errors.

§signal_handler: bool

Whether to enable signal handling (e.g., Ctrl+C).

§bracketed_paste: bool

Whether to enable bracketed paste mode.

§output_writer: Option<Arc<Mutex<dyn AsyncWrite + Send + Unpin>>>

Optional custom output writer.

§cancellation_token: Option<CancellationToken>

Optional cancellation token for external control.

§input_source: Option<InputSource>

Optional custom input source.

§event_channel_buffer: Option<usize>

The buffer size for the event channel (None for unbounded, Some(size) for bounded).

§memory_monitoring: bool

Whether to enable memory usage monitoring.

§environment: Option<HashMap<String, String>>

Optional environment variables to apply to external process commands.

Trait Implementations§

Source§

impl Debug for ProgramConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProgramConfig

Source§

fn default() -> Self

Returns the default ProgramConfig.

By default, the program does not use the alternate screen, has no mouse motion reporting, does not report focus, targets 60 FPS, enables rendering, catches panics, handles signals, and disables bracketed paste.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.