pub struct PtyBatchConfig {
pub max_bytes: usize,
pub flush_timeout: Duration,
}Expand description
Flush thresholds for PtyOutputBatcher.
max_bytes is a trigger, not a hard output bound: one pushed slice is
appended whole before the threshold is checked, so a resulting event can be
larger. flush_timeout measures inactivity since the latest non-empty push.
§Examples
use std::time::Duration;
use ailloli_ui_terminal_pty::PtyBatchConfig;
let config = PtyBatchConfig { max_bytes: 1024, flush_timeout: Duration::from_millis(5) };
assert_eq!(config.max_bytes, 1024);Fields§
§max_bytes: usizePending-byte count at or above which a push flushes; zero clamps to one.
flush_timeout: DurationMinimum inactivity before PtyOutputBatcher::tick flushes.
A zero duration makes the next tick immediately eligible.
Trait Implementations§
Source§impl Clone for PtyBatchConfig
impl Clone for PtyBatchConfig
Source§fn clone(&self) -> PtyBatchConfig
fn clone(&self) -> PtyBatchConfig
Returns a copy 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 PtyBatchConfig
impl Debug for PtyBatchConfig
Source§impl Default for PtyBatchConfig
impl Default for PtyBatchConfig
Source§fn default() -> Self
fn default() -> Self
Uses a 4,096-byte trigger and a 12-millisecond inactivity timeout.
§Examples
use std::time::Duration;
use ailloli_ui_terminal_pty::PtyBatchConfig;
let config = PtyBatchConfig::default();
assert_eq!(config.max_bytes, 4_096);
assert_eq!(config.flush_timeout, Duration::from_millis(12));Source§impl PartialEq for PtyBatchConfig
impl PartialEq for PtyBatchConfig
impl Copy for PtyBatchConfig
impl Eq for PtyBatchConfig
impl StructuralPartialEq for PtyBatchConfig
Auto Trait Implementations§
impl Freeze for PtyBatchConfig
impl RefUnwindSafe for PtyBatchConfig
impl Send for PtyBatchConfig
impl Sync for PtyBatchConfig
impl Unpin for PtyBatchConfig
impl UnwindSafe for PtyBatchConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.