pub enum Positive<const T: i8> {}Expand description
Matches when number is above 0.
#![feature(generic_const_exprs)]
use checks::{ Passed, i8::* };
struct PositiveTest<const T: i8>
where
Positive<T>: Passed;
let works = PositiveTest::<1>; // Success!
let works = PositiveTest::<50>; // Success!
let works = PositiveTest::<3>; // Success!ⓘ
let doesnt_work = PositiveTest::<0>; // Compile error!
let doesnt_work = PositiveTest::<- 55>; // Compile error!
let doesnt_work = PositiveTest::<- 3>; // Compile error!Implementations§
Trait Implementations§
impl<const T: i8> Conclusion<{ $name::<$($param),*>::simplify() }> for Positive<T>
Auto Trait Implementations§
impl<const T: i8> Freeze for Positive<T>
impl<const T: i8> RefUnwindSafe for Positive<T>
impl<const T: i8> Send for Positive<T>
impl<const T: i8> Sync for Positive<T>
impl<const T: i8> Unpin for Positive<T>
impl<const T: i8> UnwindSafe for Positive<T>
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