#[derive(Copy, Clone, PartialEq, Eq)]
pub struct U256([u64;4]);
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct U512([u64;8]);
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct Decimal {
value: U256,
scale: i64,
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct ParseDecimalError;
impl Display for ParseDecimalError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "xxx")
}
}
impl Display for Decimal {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "xxx")
}
}
impl std::error::Error for ParseDecimalError {
fn description(&self) -> &str {
"failed to parse decimal"
}
}
use std::fmt::Display;
use std::str::FromStr;
impl FromStr for Decimal {
type Err = ParseDecimalError;
#[inline]
fn from_str(_s: &str) -> Result<Decimal, ParseDecimalError> {
Ok(Decimal {
value: U256(Default::default()),
scale: 0,
})
}
}