pub trait TonCellNum:
Display
+ Sized
+ Clone {
type Primitive: Zero + Integer;
type UnsignedPrimitive: Integer;
const SIGNED: bool;
const IS_PRIMITIVE: bool = false;
// Required methods
fn tcn_from_bytes(bytes: &[u8]) -> Self;
fn tcn_to_bytes(&self) -> Vec<u8> ⓘ;
fn tcn_from_primitive(value: Self::Primitive) -> Self;
fn tcn_to_unsigned_primitive(&self) -> Option<Self::UnsignedPrimitive>;
fn tcn_is_zero(&self) -> bool;
fn tcn_min_bits_len(&self) -> usize;
fn tcn_shr(&self, bits: u32) -> Self;
}
Expand description
Allows generic read/write operation for any numeric type
Required Associated Constants§
Provided Associated Constants§
const IS_PRIMITIVE: bool = false
Required Associated Types§
Required Methods§
fn tcn_from_bytes(bytes: &[u8]) -> Self
fn tcn_to_bytes(&self) -> Vec<u8> ⓘ
fn tcn_from_primitive(value: Self::Primitive) -> Self
fn tcn_to_unsigned_primitive(&self) -> Option<Self::UnsignedPrimitive>
fn tcn_is_zero(&self) -> bool
fn tcn_min_bits_len(&self) -> usize
fn tcn_shr(&self, bits: u32) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.