pub struct GuardedBrick<B: Brick> { /* private fields */ }Expand description
Wrapper that adds invariant checking to a brick
Implementations§
Source§impl<B: Brick> GuardedBrick<B>
impl<B: Brick> GuardedBrick<B>
Sourcepub fn guard(self, guard: InvariantGuard) -> Self
pub fn guard(self, guard: InvariantGuard) -> Self
Add an invariant guard
Sourcepub fn check_guards(&self, state: &BrickState) -> Result<(), GuardViolation>
pub fn check_guards(&self, state: &BrickState) -> Result<(), GuardViolation>
Check all guards against state
Sourcepub fn guards(&self) -> &[InvariantGuard]
pub fn guards(&self) -> &[InvariantGuard]
Get guards
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for GuardedBrick<B>where
B: Freeze,
impl<B> RefUnwindSafe for GuardedBrick<B>where
B: RefUnwindSafe,
impl<B> Send for GuardedBrick<B>
impl<B> Sync for GuardedBrick<B>
impl<B> Unpin for GuardedBrick<B>where
B: Unpin,
impl<B> UnsafeUnpin for GuardedBrick<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for GuardedBrick<B>where
B: UnwindSafe,
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> 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