ProgramOptions

Struct ProgramOptions 

Source
pub struct ProgramOptions {
    pub alt_screen: bool,
    pub mouse_mode: MouseMode,
    pub bracketed_paste: bool,
    pub focus_reporting: bool,
    pub fps: u16,
    pub headless: bool,
    pub install_signal_handler: bool,
    pub without_renderer: bool,
    pub output: Option<Box<dyn Write + Send + Sync>>,
    pub input: Option<Box<dyn Read + Send + Sync>>,
    pub panic_recovery_strategy: PanicRecoveryStrategy,
    pub resource_limits: ResourceLimits,
}
Expand description

Options for configuring the program

Fields§

§alt_screen: bool

Whether to use alternate screen

§mouse_mode: MouseMode

Mouse tracking mode

§bracketed_paste: bool

Enable bracketed paste mode

§focus_reporting: bool

Enable focus reporting

§fps: u16

Frames per second (0 = unlimited)

§headless: bool

Run in headless mode without rendering

§install_signal_handler: bool

Disable signal handlers

§without_renderer: bool

Disable renderer

§output: Option<Box<dyn Write + Send + Sync>>

Custom output writer

§input: Option<Box<dyn Read + Send + Sync>>

Custom input reader

§panic_recovery_strategy: PanicRecoveryStrategy

Panic recovery strategy for Model methods

§resource_limits: ResourceLimits

Resource limits for async task execution

Implementations§

Source§

impl ProgramOptions

Source

pub fn new() -> Self

Create new default options

Source

pub fn with_alt_screen(self, enable: bool) -> Self

Enable or disable alternate screen

Source

pub fn with_mouse_mode(self, mode: MouseMode) -> Self

Set mouse tracking mode

Source

pub fn with_bracketed_paste(self, enable: bool) -> Self

Enable bracketed paste mode

Source

pub fn with_focus_reporting(self, enable: bool) -> Self

Enable focus reporting

Source

pub fn with_fps(self, fps: u16) -> Self

Set frames per second

Source

pub fn headless(self) -> Self

Run in headless mode

Source

pub fn without_signal_handler(self) -> Self

Disable signal handlers

Source

pub fn without_renderer(self) -> Self

Disable renderer

Source

pub fn with_panic_recovery(self, strategy: PanicRecoveryStrategy) -> Self

Set panic recovery strategy for Model methods

Source

pub fn with_output(self, output: Box<dyn Write + Send + Sync>) -> Self

Set custom output

Source

pub fn with_input(self, input: Box<dyn Read + Send + Sync>) -> Self

Set custom input source

Source

pub fn with_input_string(self, input: &str) -> Self

Set input from a string (convenience method for testing)

Source

pub fn with_resource_limits(self, limits: ResourceLimits) -> Self

Set resource limits for async task execution

Trait Implementations§

Source§

impl Default for ProgramOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Inspectable for T

Source§

fn inspect(self, label: &str) -> Self
where Self: Debug,

Inspect this value with a label
Source§

fn inspect_if(self, condition: bool, label: &str) -> Self
where Self: Debug,

Conditionally inspect this value
Source§

fn inspect_with<F>(self, label: &str, f: F) -> Self
where F: FnOnce(&Self) -> String,

Inspect with a custom formatter
Source§

fn tap<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Tap into the value for side effects
Source§

fn tap_if<F>(self, condition: bool, f: F) -> Self
where F: FnOnce(&Self),

Conditionally tap into the value
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.
Source§

impl<T> Message for T
where T: Send + 'static,