pub struct RuntimeDiffConfig {
pub bayesian_enabled: bool,
pub dirty_rows_enabled: bool,
pub dirty_span_config: DirtySpanConfig,
pub tile_diff_config: TileDiffConfig,
pub reset_on_resize: bool,
pub reset_on_invalidation: bool,
pub strategy_config: DiffStrategyConfig,
}Expand description
Runtime-level configuration for diff strategy selection.
This wraps DiffStrategyConfig and adds runtime-specific toggles
for enabling/disabling features and controlling reset policies.
§Example
use ftui_runtime::{RuntimeDiffConfig, DiffStrategyConfig};
// Use defaults (Bayesian selection enabled, dirty-rows enabled)
let config = RuntimeDiffConfig::default();
// Disable Bayesian selection (always use dirty-rows if available)
let config = RuntimeDiffConfig::default()
.with_bayesian_enabled(false);
// Custom cost model
let config = RuntimeDiffConfig::default()
.with_strategy_config(DiffStrategyConfig {
c_emit: 10.0, // Higher I/O cost
..Default::default()
});Fields§
§bayesian_enabled: boolEnable Bayesian strategy selection.
When enabled, the selector uses a Beta posterior over the change rate to choose between Full, DirtyRows, and FullRedraw strategies.
When disabled, always uses DirtyRows if dirty tracking is available, otherwise Full.
Default: true
dirty_rows_enabled: boolEnable dirty-row optimization.
When enabled, the DirtyRows strategy is available for selection. When disabled, the selector chooses between Full and FullRedraw only.
Default: true
dirty_span_config: DirtySpanConfigDirty-span tracking configuration (thresholds + feature flags).
Controls span merging, guard bands, and enable/disable behavior.
tile_diff_config: TileDiffConfigTile-based diff skipping configuration (thresholds + feature flags).
Controls SAT tile size, thresholds, and enable/disable behavior.
reset_on_resize: boolReset posterior on dimension change.
When true, the Bayesian posterior resets to priors when the buffer dimensions change (e.g., terminal resize).
Default: true
reset_on_invalidation: boolReset posterior on buffer invalidation.
When true, resets to priors when the previous buffer becomes invalid (e.g., mode switch, scroll region change).
Default: true
strategy_config: DiffStrategyConfigUnderlying strategy configuration.
Contains cost model constants, prior parameters, and decay settings.
Implementations§
Source§impl RuntimeDiffConfig
impl RuntimeDiffConfig
Sourcepub fn new() -> RuntimeDiffConfig
pub fn new() -> RuntimeDiffConfig
Create a new config with all defaults.
Sourcepub fn with_bayesian_enabled(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_bayesian_enabled(self, enabled: bool) -> RuntimeDiffConfig
Set whether Bayesian strategy selection is enabled.
Sourcepub fn with_dirty_rows_enabled(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_dirty_rows_enabled(self, enabled: bool) -> RuntimeDiffConfig
Set whether dirty-row optimization is enabled.
Sourcepub fn with_dirty_spans_enabled(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_dirty_spans_enabled(self, enabled: bool) -> RuntimeDiffConfig
Set whether dirty-span tracking is enabled.
Sourcepub fn with_dirty_span_config(
self,
config: DirtySpanConfig,
) -> RuntimeDiffConfig
pub fn with_dirty_span_config( self, config: DirtySpanConfig, ) -> RuntimeDiffConfig
Set the dirty-span tracking configuration.
Sourcepub fn with_tile_skip_enabled(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_tile_skip_enabled(self, enabled: bool) -> RuntimeDiffConfig
Toggle tile-based skipping.
Sourcepub fn with_tile_diff_config(self, config: TileDiffConfig) -> RuntimeDiffConfig
pub fn with_tile_diff_config(self, config: TileDiffConfig) -> RuntimeDiffConfig
Set the tile-based diff configuration.
Sourcepub fn with_reset_on_resize(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_reset_on_resize(self, enabled: bool) -> RuntimeDiffConfig
Set whether to reset posterior on resize.
Sourcepub fn with_reset_on_invalidation(self, enabled: bool) -> RuntimeDiffConfig
pub fn with_reset_on_invalidation(self, enabled: bool) -> RuntimeDiffConfig
Set whether to reset posterior on invalidation.
Sourcepub fn with_strategy_config(
self,
config: DiffStrategyConfig,
) -> RuntimeDiffConfig
pub fn with_strategy_config( self, config: DiffStrategyConfig, ) -> RuntimeDiffConfig
Set the underlying strategy configuration.
Trait Implementations§
Source§impl Clone for RuntimeDiffConfig
impl Clone for RuntimeDiffConfig
Source§fn clone(&self) -> RuntimeDiffConfig
fn clone(&self) -> RuntimeDiffConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeDiffConfig
impl Debug for RuntimeDiffConfig
Source§impl Default for RuntimeDiffConfig
impl Default for RuntimeDiffConfig
Source§fn default() -> RuntimeDiffConfig
fn default() -> RuntimeDiffConfig
Auto Trait Implementations§
impl Freeze for RuntimeDiffConfig
impl RefUnwindSafe for RuntimeDiffConfig
impl Send for RuntimeDiffConfig
impl Sync for RuntimeDiffConfig
impl Unpin for RuntimeDiffConfig
impl UnsafeUnpin for RuntimeDiffConfig
impl UnwindSafe for RuntimeDiffConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().