pub struct BigNum(/* private fields */);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 CheckedAdd for BigNum
impl CheckedAdd for BigNum
Source§fn checked_add(&self, v: &Self) -> Option<Self>
fn checked_add(&self, v: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl CheckedDiv for BigNum
impl CheckedDiv for BigNum
Source§fn checked_div(&self, v: &Self) -> Option<Self>
fn checked_div(&self, v: &Self) -> Option<Self>
Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens,
None is returned.Source§impl CheckedMul for BigNum
impl CheckedMul for BigNum
Source§fn checked_mul(&self, v: &Self) -> Option<Self>
fn checked_mul(&self, v: &Self) -> Option<Self>
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens,
None is returned.Source§impl CheckedSub for BigNum
impl CheckedSub for BigNum
Source§fn checked_sub(&self, v: &Self) -> Option<Self>
fn checked_sub(&self, v: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.impl Copy for BigNum
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
impl Eq for BigNum
Source§impl Extend<BigNum> for TransactionMetadatumLabels
impl Extend<BigNum> for TransactionMetadatumLabels
Source§fn extend<I: IntoIterator<Item = TransactionMetadatumLabel>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = TransactionMetadatumLabel>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<BigNum> for PlutusDataEnum
impl From<BigNum> for PlutusDataEnum
Source§impl FromIterator<BigNum> for TransactionMetadatumLabels
impl FromIterator<BigNum> for TransactionMetadatumLabels
Source§fn from_iter<I: IntoIterator<Item = TransactionMetadatumLabel>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = TransactionMetadatumLabel>>(iter: I) -> Self
Creates a value from an iterator. Read more
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
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for BigNum
impl PartialOrd for BigNum
Source§impl SaturatingAdd for BigNum
impl SaturatingAdd for BigNum
Source§fn saturating_add(&self, v: &Self) -> Self
fn saturating_add(&self, v: &Self) -> Self
Saturating addition. Computes
self + other, saturating at the relevant high or low boundary of
the type.Source§impl SaturatingSub for BigNum
impl SaturatingSub for BigNum
Source§fn saturating_sub(&self, v: &Self) -> Self
fn saturating_sub(&self, v: &Self) -> Self
Saturating subtraction. Computes
self - other, saturating at the relevant high or low boundary of
the type.Source§impl Serialize for BigNum
impl Serialize for BigNum
fn serialize<'se, W: Write>( &self, serializer: &'se mut Serializer<W>, ) -> Result<&'se mut Serializer<W>>
impl StructuralPartialEq for BigNum
Auto Trait Implementations§
impl Freeze for BigNum
impl RefUnwindSafe for BigNum
impl Send for BigNum
impl Sync for BigNum
impl Unpin for BigNum
impl UnsafeUnpin for BigNum
impl UnwindSafe for BigNum
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more