pub enum BrickAssertion {
TextVisible,
ContrastRatio(f32),
MaxLatencyMs(u32),
ElementPresent(String),
Focusable,
Custom {
name: String,
validator_id: u64,
},
}Expand description
Brick assertion that must be verified at runtime.
Assertions are falsifiable hypotheses about the UI state. If any assertion fails, the brick is falsified.
Variants§
TextVisible
Text content must be visible (not hidden, not zero-opacity)
ContrastRatio(f32)
WCAG 2.1 AA contrast ratio requirement (4.5:1 for normal text)
MaxLatencyMs(u32)
Maximum render latency in milliseconds
ElementPresent(String)
Element must be present in DOM
Focusable
Element must be focusable for accessibility
Custom
Custom assertion with name and validation function ID
Implementations§
Source§impl BrickAssertion
impl BrickAssertion
Sourcepub const fn text_visible() -> BrickAssertion
pub const fn text_visible() -> BrickAssertion
Create a text visibility assertion
Sourcepub const fn contrast_ratio(ratio: f32) -> BrickAssertion
pub const fn contrast_ratio(ratio: f32) -> BrickAssertion
Create a contrast ratio assertion (WCAG 2.1 AA)
Sourcepub const fn max_latency_ms(ms: u32) -> BrickAssertion
pub const fn max_latency_ms(ms: u32) -> BrickAssertion
Create a max latency assertion
Sourcepub fn element_present(selector: impl Into<String>) -> BrickAssertion
pub fn element_present(selector: impl Into<String>) -> BrickAssertion
Create an element presence assertion
Trait Implementations§
Source§impl Clone for BrickAssertion
impl Clone for BrickAssertion
Source§fn clone(&self) -> BrickAssertion
fn clone(&self) -> BrickAssertion
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 BrickAssertion
impl Debug for BrickAssertion
Source§impl PartialEq for BrickAssertion
impl PartialEq for BrickAssertion
impl StructuralPartialEq for BrickAssertion
Auto Trait Implementations§
impl Freeze for BrickAssertion
impl RefUnwindSafe for BrickAssertion
impl Send for BrickAssertion
impl Sync for BrickAssertion
impl Unpin for BrickAssertion
impl UnwindSafe for BrickAssertion
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,
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>
Converts
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>
Converts
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 more