Trait Magnitude

Source
pub trait Magnitude
where Self: Sized + PartialOrd + Copy,
{ const NBITS: usize;
Show 15 methods // Required methods fn abs_diff(&self, rhs: &Self) -> Self; fn wrapping_add(&self, rhs: &Self) -> Self; fn wrapping_mul(&self, rhs: &Self) -> Self; fn wrapping_sub(&self, rhs: &Self) -> Self; fn checked_add(&self, rhs: &Self) -> Option<Self>; fn checked_mul(&self, rhs: &Self) -> Option<Self>; fn checked_sub(&self, rhs: &Self) -> Option<Self>; fn checked_div(&self, rhs: &Self) -> Option<Self>; fn checked_rem(&self, rhs: &Self) -> Option<Self>; fn is_zero(&self) -> bool; fn zero() -> Self; fn to_field<F: FieldWitness>(&self) -> F; fn of_field<F: FieldWitness>(field: F) -> Self; // Provided methods fn add_flagged(&self, rhs: &Self) -> (Self, bool) { ... } fn sub_flagged(&self, rhs: &Self) -> (Self, bool) { ... }
}

Required Associated Constants§

Required Methods§

Source

fn abs_diff(&self, rhs: &Self) -> Self

Source

fn wrapping_add(&self, rhs: &Self) -> Self

Source

fn wrapping_mul(&self, rhs: &Self) -> Self

Source

fn wrapping_sub(&self, rhs: &Self) -> Self

Source

fn checked_add(&self, rhs: &Self) -> Option<Self>

Source

fn checked_mul(&self, rhs: &Self) -> Option<Self>

Source

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source

fn checked_div(&self, rhs: &Self) -> Option<Self>

Source

fn checked_rem(&self, rhs: &Self) -> Option<Self>

Source

fn is_zero(&self) -> bool

Source

fn zero() -> Self

Source

fn to_field<F: FieldWitness>(&self) -> F

Source

fn of_field<F: FieldWitness>(field: F) -> Self

Provided Methods§

Source

fn add_flagged(&self, rhs: &Self) -> (Self, bool)

Source

fn sub_flagged(&self, rhs: &Self) -> (Self, bool)

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.

Implementors§

Source§

impl Magnitude for Amount

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for Balance

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for BlockTime

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for BlockTimeSpan

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for Epoch

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for Fee

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for Index

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for Length

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for N

Source§

const NBITS: usize = 64usize

Source§

impl Magnitude for Nonce

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for Slot

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for SlotSpan

Source§

const NBITS: usize = 32usize

Source§

impl Magnitude for TxnVersion

Source§

const NBITS: usize = 32usize