[][src]Trait elrond_wasm::BigUintApi

pub trait BigUintApi: Sized + From<u64> + From<u32> + From<usize> + Clone + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + Mul<Output = Self> + MulAssign + Div<Output = Self> + DivAssign + Rem<Output = Self> + RemAssign + BitAnd<Output = Self> + BitAndAssign + BitOr<Output = Self> + BitOrAssign + BitXor<Output = Self> + BitXorAssign + Shr<usize, Output = Self> + ShrAssign<usize> + Shl<usize, Output = Self> + ShlAssign<usize> + PartialEq<Self> + Eq + PartialOrd<Self> + Ord + PartialEq<u64> + PartialOrd<u64> + NestedEncode + TopEncode + NestedDecode + TopDecode + TypeAbi {
    pub fn byte_length(&self) -> i32;
pub fn copy_to_slice_big_endian(&self, slice: &mut [u8]) -> i32;
pub fn copy_to_array_big_endian_pad_right(&self, target: &mut [u8; 32]);
pub fn to_bytes_be(&self) -> Vec<u8>;
pub fn to_bytes_be_pad_right(&self, nr_bytes: usize) -> Option<Vec<u8>>;
pub fn from_bytes_be(bytes: &[u8]) -> Self; pub fn zero() -> Self { ... } }

Definition of the BigUint type required by the API. The API doesn't care about the actual BigInt implementation. The Arwen VM provides an implementation directly in the protocol. For debugging we use a different implementation, based on Rust's BigInt.

Since most values in smart contracts will not be signed, as well as for safety, most of the functionality if provided for unsigned integers.

Required methods

pub fn byte_length(&self) -> i32[src]

pub fn copy_to_slice_big_endian(&self, slice: &mut [u8]) -> i32[src]

pub fn copy_to_array_big_endian_pad_right(&self, target: &mut [u8; 32])[src]

pub fn to_bytes_be(&self) -> Vec<u8>[src]

pub fn to_bytes_be_pad_right(&self, nr_bytes: usize) -> Option<Vec<u8>>[src]

pub fn from_bytes_be(bytes: &[u8]) -> Self[src]

Loading content...

Provided methods

pub fn zero() -> Self[src]

Loading content...

Implementors

Loading content...