pub struct ScreenshotComparison {
pub threshold: f64,
pub max_diff_pixels: Option<usize>,
pub max_diff_pixel_ratio: Option<f64>,
pub mask_regions: Vec<MaskRegion>,
}Expand description
Screenshot comparison configuration (Playwright API parity)
Fields§
§threshold: f64Threshold for comparison (0.0-1.0)
max_diff_pixels: Option<usize>Maximum number of pixels that can differ
max_diff_pixel_ratio: Option<f64>Maximum ratio of pixels that can differ (0.0-1.0)
mask_regions: Vec<MaskRegion>Regions to mask (exclude from comparison)
Implementations§
Source§impl ScreenshotComparison
impl ScreenshotComparison
Sourcepub const fn with_threshold(self, threshold: f64) -> Self
pub const fn with_threshold(self, threshold: f64) -> Self
Set threshold for comparison
Sourcepub const fn with_max_diff_pixels(self, pixels: usize) -> Self
pub const fn with_max_diff_pixels(self, pixels: usize) -> Self
Set maximum number of differing pixels
Sourcepub const fn with_max_diff_pixel_ratio(self, ratio: f64) -> Self
pub const fn with_max_diff_pixel_ratio(self, ratio: f64) -> Self
Set maximum ratio of differing pixels
Sourcepub fn with_mask(self, mask: MaskRegion) -> Self
pub fn with_mask(self, mask: MaskRegion) -> Self
Add a mask region to exclude from comparison
Trait Implementations§
Source§impl Clone for ScreenshotComparison
impl Clone for ScreenshotComparison
Source§fn clone(&self) -> ScreenshotComparison
fn clone(&self) -> ScreenshotComparison
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 ScreenshotComparison
impl Debug for ScreenshotComparison
Source§impl Default for ScreenshotComparison
impl Default for ScreenshotComparison
Source§fn default() -> ScreenshotComparison
fn default() -> ScreenshotComparison
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScreenshotComparison
impl RefUnwindSafe for ScreenshotComparison
impl Send for ScreenshotComparison
impl Sync for ScreenshotComparison
impl Unpin for ScreenshotComparison
impl UnsafeUnpin for ScreenshotComparison
impl UnwindSafe for ScreenshotComparison
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