Struct cosmwasm_std::Uint512 [−][src]
pub struct Uint512(_);
Expand description
An implementation of u512 that is using strings for JSON encoding/decoding, such that the full u512 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Examples
Use from
to create instances out of primitive uint types or new
to provide big
endian bytes:
let a = Uint512::from(258u128);
let b = Uint512::new([
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8,
0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 1u8, 2u8,
]);
assert_eq!(a, b);
Implementations
Creates a Uint512(value) from a big endian representation. It’s just an alias for
from_big_endian
.
Returns a copy of the number as big endian bytes.
Returns a copy of the number as little endian bytes.
Trait Implementations
Performs the +=
operation. Read more
Performs the +=
operation. Read more
Deserialized from an integer string using base 10
Performs the /=
operation. Read more
Performs the /=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the >>=
operation. Read more
Performs the >>=
operation. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Uint512
impl UnwindSafe for Uint512
Blanket Implementations
Mutably borrows from an owned value. Read more