use core::ops::{
Add,
BitAnd,
BitOr,
BitXor,
Not,
Sub,
};
use crate::Radium;
pub trait BitOps:
Sized
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ BitXor<Output = Self>
+ Not<Output = Self>
{
}
pub trait NumericOps:
BitOps + Add<Output = Self> + Sub<Output = Self> + PartialEq + Ord
{
}
macro_rules! mark {
($($t:ty => $($u:ty),+ $(,)?);+ $(;)?) => { $( $(
impl $t for $u {}
)+ )+ };
}
mark! {
BitOps => bool, i8, u8, i16, u16, i32, u32, i64, u64, i128, u128, isize, usize;
NumericOps => i8, u8, i16, u16, i32, u32, i64, u64, i128, u128, isize, usize;
}
pub trait Atomic: Copy {
type Atom: Radium<Item = Self> + Send + Sync;
}
pub trait Nuclear: Copy {
type Nucleus: Radium<Item = Self>;
}