Struct cardano_serialization_lib::utils::BigNum
source · pub struct BigNum(_);
Implementations§
source§impl BigNum
impl BigNum
pub fn from_bytes(bytes: Vec<u8>) -> Result<BigNum, DeserializeError>
source§impl BigNum
impl BigNum
pub fn from_str(string: &str) -> Result<BigNum, JsError>
pub fn to_str(&self) -> String
pub fn zero() -> Self
pub fn one() -> Self
pub fn is_zero(&self) -> bool
pub fn div_floor(&self, other: &BigNum) -> BigNum
pub fn checked_mul(&self, other: &BigNum) -> Result<BigNum, JsError>
pub fn checked_add(&self, other: &BigNum) -> Result<BigNum, JsError>
pub fn checked_sub(&self, other: &BigNum) -> Result<BigNum, JsError>
sourcepub fn clamped_sub(&self, other: &BigNum) -> BigNum
pub fn clamped_sub(&self, other: &BigNum) -> BigNum
returns 0 if it would otherwise underflow
pub fn compare(&self, rhs_value: &BigNum) -> i8
pub fn less_than(&self, rhs_value: &BigNum) -> bool
pub fn max_value() -> BigNum
pub fn max(a: &BigNum, b: &BigNum) -> BigNum
Trait Implementations§
source§impl<'de> Deserialize<'de> for BigNum
impl<'de> Deserialize<'de> for BigNum
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Deserialize for BigNum
impl Deserialize for BigNum
fn deserialize<R: BufRead + Seek>( raw: &mut Deserializer<R> ) -> Result<Self, DeserializeError>
source§impl JsonSchema for BigNum
impl JsonSchema for BigNum
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Ord for BigNum
impl Ord for BigNum
source§impl PartialEq<BigNum> for BigNum
impl PartialEq<BigNum> for BigNum
source§impl PartialOrd<BigNum> for BigNum
impl PartialOrd<BigNum> for BigNum
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more