pub struct RunConfig {
pub tick_rate: Duration,
pub mouse: bool,
pub theme: Theme,
pub max_fps: Option<u32>,
}Expand description
Configuration for a TUI run loop.
Pass to run_with or run_inline_with to customize behavior.
Use Default::default() for sensible defaults (100ms tick, no mouse, dark theme).
§Example
use slt::{RunConfig, Theme};
use std::time::Duration;
let config = RunConfig {
tick_rate: Duration::from_millis(50),
mouse: true,
theme: Theme::light(),
max_fps: Some(60),
};Fields§
§tick_rate: DurationHow long to wait for input before triggering a tick with no events.
Lower values give smoother animations at the cost of more CPU usage. Defaults to 100ms.
mouse: boolWhether to enable mouse event reporting.
When true, the terminal captures mouse clicks, scrolls, and movement.
Defaults to false.
theme: ThemeThe color theme applied to all widgets automatically.
Defaults to Theme::dark().
max_fps: Option<u32>Optional maximum frame rate.
None means unlimited frame rate. Some(fps) sleeps at the end of each
loop iteration to target that frame time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RunConfig
impl RefUnwindSafe for RunConfig
impl Send for RunConfig
impl Sync for RunConfig
impl Unpin for RunConfig
impl UnsafeUnpin for RunConfig
impl UnwindSafe for RunConfig
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