Trait near_primitives_core::serialize::dec_format::DecType
source · pub trait DecType: Sized {
// Required methods
fn serialize(&self) -> Option<String>;
fn try_from_str(value: &str) -> Result<Self, ParseIntError>;
fn from_u64(value: u64) -> Self;
// Provided method
fn try_from_unit() -> Result<Self, ParseUnitError> { ... }
}
Expand description
Abstraction between integers that we serialise.
Required Methods§
sourcefn try_from_str(value: &str) -> Result<Self, ParseIntError>
fn try_from_str(value: &str) -> Result<Self, ParseIntError>
Tries to parse decimal string as an integer.
Provided Methods§
sourcefn try_from_unit() -> Result<Self, ParseUnitError>
fn try_from_unit() -> Result<Self, ParseUnitError>
Constructs Self from a null
value. Returns error if this type
does not accept null
values.
Object Safety§
This trait is not object safe.