pub struct DiffConfig { /* private fields */ }Expand description
Configuration for diff computation.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.mask("*.password")
.mask("api.secret")
.float_tolerance("metrics.*", 1e-6)
.collection_limit(500);Implementations§
Source§impl DiffConfig
impl DiffConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new configuration with default settings.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new();Sourcepub fn ignore(self, pattern: &str) -> Self
pub fn ignore(self, pattern: &str) -> Self
Ignore changes at matching paths.
Supports glob patterns like *.password or database.*.credentials.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.ignore("internal.*")
.ignore("*.temp");Sourcepub fn mask(self, pattern: &str) -> Self
pub fn mask(self, pattern: &str) -> Self
Mask values at matching paths.
Masked values will show as “***” in output instead of actual values.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.mask("*.password")
.mask("api.secret");Sourcepub fn float_tolerance(self, pattern: &str, tolerance: f64) -> Self
pub fn float_tolerance(self, pattern: &str, tolerance: f64) -> Self
Set float tolerance for specific paths.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.float_tolerance("metrics.*.value", 1e-6);Sourcepub fn default_float_tolerance(self, tolerance: f64) -> Self
pub fn default_float_tolerance(self, tolerance: f64) -> Self
Set default float tolerance for all floats.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.default_float_tolerance(1e-9);Sourcepub fn max_depth(self, depth: usize) -> Self
pub fn max_depth(self, depth: usize) -> Self
Set maximum traversal depth.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.max_depth(32);Sourcepub fn collection_limit(self, limit: usize) -> Self
pub fn collection_limit(self, limit: usize) -> Self
Set maximum collection size to diff.
Collections larger than this limit will be elided.
§Examples
use diffo::DiffConfig;
let config = DiffConfig::new()
.collection_limit(500);Trait Implementations§
Source§impl Clone for DiffConfig
impl Clone for DiffConfig
Source§fn clone(&self) -> DiffConfig
fn clone(&self) -> DiffConfig
Returns a duplicate 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 DiffConfig
impl Debug for DiffConfig
Auto Trait Implementations§
impl Freeze for DiffConfig
impl RefUnwindSafe for DiffConfig
impl Send for DiffConfig
impl Sync for DiffConfig
impl Unpin for DiffConfig
impl UnwindSafe for DiffConfig
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