pub struct SimpleBrick { /* private fields */ }Expand description
Simple Brick implementation for common use cases.
Provides a straightforward way to define brick assertions and budgets without implementing the full Brick trait manually.
Implementations§
Source§impl SimpleBrick
impl SimpleBrick
Sourcepub fn with_assertion(self, assertion: BrickAssertion) -> Self
pub fn with_assertion(self, assertion: BrickAssertion) -> Self
Add an assertion to this brick.
Sourcepub const fn with_budget(self, budget: BrickBudget) -> Self
pub const fn with_budget(self, budget: BrickBudget) -> Self
Set the performance budget.
Sourcepub const fn with_custom_verify(self, verify: fn() -> bool) -> Self
pub const fn with_custom_verify(self, verify: fn() -> bool) -> Self
Add a custom verification function.
Trait Implementations§
Source§impl Brick for SimpleBrick
impl Brick for SimpleBrick
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl Clone for SimpleBrick
impl Clone for SimpleBrick
Source§fn clone(&self) -> SimpleBrick
fn clone(&self) -> SimpleBrick
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 moreAuto Trait Implementations§
impl Freeze for SimpleBrick
impl RefUnwindSafe for SimpleBrick
impl Send for SimpleBrick
impl Sync for SimpleBrick
impl Unpin for SimpleBrick
impl UnwindSafe for SimpleBrick
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> BrickWidgetExt for Twhere
T: Brick,
impl<T> BrickWidgetExt for Twhere
T: Brick,
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