pub enum ExclP<A> {
Unit,
Excl(Option<A>),
ExclInvalid,
}Variants§
Implementations§
Trait Implementations§
Source§impl<A> Protocol<(), A> for ExclP<A>
impl<A> Protocol<(), A> for ExclP<A>
Source§open spec fn op(self, other: Self) -> Self
open spec fn op(self, other: Self) -> Self
{
match (self, other) {
(ExclP::Unit, x) => x,
(x, ExclP::Unit) => x,
_ => ExclP::ExclInvalid,
}
}Source§open spec fn rel(self, s: Map<(), A>) -> bool
open spec fn rel(self, s: Map<(), A>) -> bool
{
match self {
ExclP::Unit => s.is_empty(),
ExclP::Excl(None) => s.is_empty(),
ExclP::Excl(Some(x)) => s =~= map![() => x],
ExclP::ExclInvalid => false,
}
}Source§proof fn commutative(a: Self, b: Self)
proof fn commutative(a: Self, b: Self)
Source§proof fn associative(a: Self, b: Self, c: Self)
proof fn associative(a: Self, b: Self, c: Self)
Auto Trait Implementations§
impl<A> Freeze for ExclP<A>where
A: Freeze,
impl<A> RefUnwindSafe for ExclP<A>where
A: RefUnwindSafe,
impl<A> Send for ExclP<A>where
A: Send,
impl<A> Sync for ExclP<A>where
A: Sync,
impl<A> Unpin for ExclP<A>where
A: Unpin,
impl<A> UnwindSafe for ExclP<A>where
A: 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