pub struct Odd<T>(/* private fields */);Expand description
Proof that a value is odd.
A bare typestate: it carries the proof but has no consuming op in this
crate. It ships here because that is where its predicate (Parity) lives.
Note that Odd also implies non-zero — zero is even — so it doubles as a
“non-zero and odd” proof without a separate OddNonZero type.
Implementations§
Source§impl<T> Odd<T>
impl<T> Odd<T>
Sourcepub const unsafe fn new_unchecked(value: T) -> Self
pub const unsafe fn new_unchecked(value: T) -> Self
§Safety
value must be odd.
Trait Implementations§
impl<T: Copy> Copy for Odd<T>
impl<T: Eq> Eq for Odd<T>
impl<T: PartialEq> StructuralPartialEq for Odd<T>
Source§impl TryFrom<i8> for Odd<i8>
impl TryFrom<i8> for Odd<i8>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<i16> for Odd<i16>
impl TryFrom<i16> for Odd<i16>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<i32> for Odd<i32>
impl TryFrom<i32> for Odd<i32>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<i64> for Odd<i64>
impl TryFrom<i64> for Odd<i64>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<i128> for Odd<i128>
impl TryFrom<i128> for Odd<i128>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<isize> for Odd<isize>
impl TryFrom<isize> for Odd<isize>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<u8> for Odd<u8>
impl TryFrom<u8> for Odd<u8>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<u16> for Odd<u16>
impl TryFrom<u16> for Odd<u16>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<u32> for Odd<u32>
impl TryFrom<u32> for Odd<u32>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Source§impl TryFrom<u64> for Odd<u64>
impl TryFrom<u64> for Odd<u64>
Source§type Error = TypestateError
type Error = TypestateError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<T> Freeze for Odd<T>where
T: Freeze,
impl<T> RefUnwindSafe for Odd<T>where
T: RefUnwindSafe,
impl<T> Send for Odd<T>where
T: Send,
impl<T> Sync for Odd<T>where
T: Sync,
impl<T> Unpin for Odd<T>where
T: Unpin,
impl<T> UnsafeUnpin for Odd<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Odd<T>where
T: 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