const STUB_MSG: &str = "arcis::std::integer is documentation-only; \
inside `#[encrypted]` code the interpreter intercepts the real method before this stub runs.";
macro_rules! supported_int_common {
($t:ident, $primitive:ty, $bytes:literal) => {
impl $t {
pub const BITS: ::core::primitive::u32 = <$primitive>::BITS;
pub const MIN: $primitive = <$primitive>::MIN;
pub const MAX: $primitive = <$primitive>::MAX;
pub fn min(self, other: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn max(self, other: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn abs_diff(self, other: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn div_ceil(self, other: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn wrapping_add(self, rhs: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn wrapping_sub(self, rhs: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn wrapping_mul(self, rhs: Self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn to_le_bytes(self) -> [::core::primitive::u8; $bytes] {
unimplemented!("{STUB_MSG}")
}
pub fn to_be_bytes(self) -> [::core::primitive::u8; $bytes] {
unimplemented!("{STUB_MSG}")
}
}
};
}
macro_rules! supported_int_signed_only {
($t:ident) => {
impl $t {
pub fn abs(self) -> Self {
unimplemented!("{STUB_MSG}")
}
pub fn is_positive(self) -> ::core::primitive::bool {
unimplemented!("{STUB_MSG}")
}
pub fn is_negative(self) -> ::core::primitive::bool {
unimplemented!("{STUB_MSG}")
}
}
};
}
macro_rules! supported_unsigned {
($t:ident, $primitive:ty, $bytes:literal) => {
#[allow(non_camel_case_types)]
pub struct $t;
supported_int_common!($t, $primitive, $bytes);
};
}
macro_rules! supported_signed {
($t:ident, $primitive:ty, $bytes:literal) => {
#[allow(non_camel_case_types)]
pub struct $t;
supported_int_common!($t, $primitive, $bytes);
supported_int_signed_only!($t);
};
}
supported_unsigned!(u8, ::core::primitive::u8, 1);
supported_unsigned!(u16, ::core::primitive::u16, 2);
supported_unsigned!(u32, ::core::primitive::u32, 4);
supported_unsigned!(u64, ::core::primitive::u64, 8);
supported_unsigned!(u128, ::core::primitive::u128, 16);
supported_unsigned!(usize, ::core::primitive::usize, 8);
supported_signed!(i8, ::core::primitive::i8, 1);
supported_signed!(i16, ::core::primitive::i16, 2);
supported_signed!(i32, ::core::primitive::i32, 4);
supported_signed!(i64, ::core::primitive::i64, 8);
supported_signed!(i128, ::core::primitive::i128, 16);
supported_signed!(isize, ::core::primitive::isize, 8);