Struct RustBigInt

Source
pub struct RustBigInt(pub BigInt);

Tuple Fields§

§0: BigInt

Implementations§

Source§

impl RustBigInt

Source

pub fn value(&self) -> &BigInt

Trait Implementations§

Source§

impl<'a, 'b> Add<&'b RustBigInt> for &'a RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the + operator.
Source§

fn add(self, other: &RustBigInt) -> RustBigInt

Performs the + operation. Read more
Source§

impl Add for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the + operator.
Source§

fn add(self, other: RustBigInt) -> RustBigInt

Performs the + operation. Read more
Source§

impl AddAssign<&RustBigInt> for RustBigInt

Source§

fn add_assign(&mut self, other: &RustBigInt)

Performs the += operation. Read more
Source§

impl AddAssign for RustBigInt

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl BigIntApi<RustBigUint> for RustBigInt

Source§

fn abs_uint(&self) -> RustBigUint

Source§

fn sign(&self) -> Sign

Source§

fn to_signed_bytes_be(&self) -> Vec<u8>

Source§

fn from_signed_bytes_be(bytes: &[u8]) -> Self

Source§

fn zero() -> Self

Source§

impl Clone for RustBigInt

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContractHookApi<RustBigInt, RustBigUint> for TxContext

Source§

fn get_sc_address(&self) -> Address

Source§

fn get_owner_address(&self) -> Address

Source§

fn get_caller(&self) -> Address

Source§

fn get_balance(&self, address: &Address) -> RustBigUint

Source§

fn storage_store_slice_u8(&self, key: &[u8], value: &[u8])

Source§

fn storage_load_vec_u8(&self, key: &[u8]) -> Vec<u8>

Source§

fn storage_load_len(&self, key: &[u8]) -> usize

Source§

fn storage_store_bytes32(&self, key: &[u8], value: &[u8; 32])

Source§

fn storage_load_bytes32(&self, key: &[u8]) -> [u8; 32]

Source§

fn storage_store_big_uint(&self, key: &[u8], value: &RustBigUint)

Source§

fn storage_load_big_uint(&self, key: &[u8]) -> RustBigUint

Source§

fn storage_store_big_uint_raw(&self, _key: &[u8], _handle: i32)

Source§

fn storage_load_big_uint_raw(&self, _key: &[u8]) -> i32

Source§

fn storage_store_big_int(&self, key: &[u8], value: &RustBigInt)

Source§

fn storage_load_big_int(&self, key: &[u8]) -> RustBigInt

Source§

fn storage_store_i64(&self, key: &[u8], value: i64)

Source§

fn storage_store_u64(&self, key: &[u8], value: u64)

Source§

fn storage_load_i64(&self, key: &[u8]) -> i64

Source§

fn storage_load_u64(&self, key: &[u8]) -> u64

Source§

fn get_call_value_big_uint(&self) -> RustBigUint

Source§

fn get_dcdt_value_big_uint(&self) -> RustBigUint

Source§

fn get_dcdt_token_name(&self) -> Vec<u8>

Source§

fn send_tx(&self, to: &Address, amount: &RustBigUint, _data: &[u8])

Source§

fn async_call(&self, to: &Address, amount: &RustBigUint, data: &[u8])

Source§

fn deploy_contract( &self, _gas: u64, _amount: &RustBigUint, _code: &BoxedBytes, _code_metadata: CodeMetadata, _arg_buffer: &ArgBuffer, ) -> Address

Source§

fn get_tx_hash(&self) -> H256

Source§

fn get_gas_left(&self) -> u64

Source§

fn get_block_timestamp(&self) -> u64

Source§

fn get_block_nonce(&self) -> u64

Source§

fn get_block_round(&self) -> u64

Source§

fn get_block_epoch(&self) -> u64

Source§

fn get_block_random_seed(&self) -> Box<[u8; 48]>

Source§

fn get_prev_block_timestamp(&self) -> u64

Source§

fn get_prev_block_nonce(&self) -> u64

Source§

fn get_prev_block_round(&self) -> u64

Source§

fn get_prev_block_epoch(&self) -> u64

Source§

fn get_prev_block_random_seed(&self) -> Box<[u8; 48]>

Source§

fn sha256(&self, data: &[u8]) -> H256

Source§

fn keccak256(&self, data: &[u8]) -> H256

Source§

fn get_sc_balance(&self) -> BigUint

Source§

fn storage_load_boxed_bytes(&self, key: &[u8]) -> BoxedBytes

Source§

fn storage_load_cumulated_validator_reward(&self) -> BigUint

Source§

impl ContractIOApi<RustBigInt, RustBigUint> for TxContext

Source§

fn get_num_arguments(&self) -> i32

Source§

fn check_not_payable(&self)

Source§

fn get_argument_len(&self, arg_index: i32) -> usize

Source§

fn copy_argument_to_slice(&self, _arg_index: i32, _slice: &mut [u8])

Source§

fn get_argument_vec_u8(&self, arg_index: i32) -> Vec<u8>

Source§

fn get_argument_boxed_bytes(&self, arg_index: i32) -> BoxedBytes

Source§

fn get_argument_big_uint(&self, arg_index: i32) -> RustBigUint

Source§

fn get_argument_big_int(&self, arg_index: i32) -> RustBigInt

Source§

fn get_argument_big_uint_raw(&self, _arg_index: i32) -> i32

Source§

fn get_argument_big_int_raw(&self, _arg_index: i32) -> i32

Source§

fn get_argument_i64(&self, arg_index: i32) -> i64

Source§

fn get_argument_u64(&self, arg_index: i32) -> u64

Source§

fn finish_slice_u8(&self, slice: &[u8])

Source§

fn finish_big_int(&self, bi: &RustBigInt)

Source§

fn finish_big_uint(&self, bu: &RustBigUint)

Source§

fn finish_big_int_raw(&self, _handle: i32)

Source§

fn finish_big_uint_raw(&self, _handle: i32)

Source§

fn finish_i64(&self, value: i64)

Source§

fn finish_u64(&self, value: u64)

Source§

fn signal_error(&self, message: &[u8]) -> !

Source§

fn write_log(&self, _topics: &[[u8; 32]], _data: &[u8])

Source§

fn check_num_arguments(&self, expected: i32)

Source§

impl Debug for RustBigInt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, 'b> Div<&'b RustBigInt> for &'a RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the / operator.
Source§

fn div(self, other: &RustBigInt) -> RustBigInt

Performs the / operation. Read more
Source§

impl Div for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the / operator.
Source§

fn div(self, other: RustBigInt) -> RustBigInt

Performs the / operation. Read more
Source§

impl DivAssign<&RustBigInt> for RustBigInt

Source§

fn div_assign(&mut self, other: &RustBigInt)

Performs the /= operation. Read more
Source§

impl DivAssign for RustBigInt

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl From<BigInt> for RustBigInt

Source§

fn from(item: BigInt) -> Self

Converts to this type from the input type.
Source§

impl From<RustBigUint> for RustBigInt

Source§

fn from(item: RustBigUint) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for RustBigInt

Source§

fn from(item: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for RustBigInt

Source§

fn from(item: i64) -> Self

Converts to this type from the input type.
Source§

impl<'a, 'b> Mul<&'b RustBigInt> for &'a RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the * operator.
Source§

fn mul(self, other: &RustBigInt) -> RustBigInt

Performs the * operation. Read more
Source§

impl Mul for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the * operator.
Source§

fn mul(self, other: RustBigInt) -> RustBigInt

Performs the * operation. Read more
Source§

impl MulAssign<&RustBigInt> for RustBigInt

Source§

fn mul_assign(&mut self, other: &RustBigInt)

Performs the *= operation. Read more
Source§

impl MulAssign for RustBigInt

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Neg for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl NestedDecode for RustBigInt

Source§

fn dep_decode<I: NestedDecodeInput>(input: &mut I) -> Result<Self, DecodeError>

Attempt to deserialise the value from input, using the format of an object nested inside another structure. In case of success returns the deserialized value and the number of bytes consumed during the operation.
Source§

fn dep_decode_or_exit<I: NestedDecodeInput, ExitCtx: Clone>( input: &mut I, c: ExitCtx, exit: fn(ExitCtx, DecodeError) -> !, ) -> Self

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error.
Source§

impl NestedEncode for RustBigInt

Source§

fn dep_encode<O: NestedEncodeOutput>( &self, dest: &mut O, ) -> Result<(), EncodeError>

NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version.
Source§

fn dep_encode_or_exit<O: NestedEncodeOutput, ExitCtx: Clone>( &self, dest: &mut O, c: ExitCtx, exit: fn(ExitCtx, EncodeError) -> !, )

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error.
Source§

impl Ord for RustBigInt

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq<i64> for RustBigInt

Source§

fn eq(&self, other: &i64) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for RustBigInt

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd<i64> for RustBigInt

Source§

fn partial_cmp(&self, other: &i64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for RustBigInt

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a, 'b> Rem<&'b RustBigInt> for &'a RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the % operator.
Source§

fn rem(self, other: &RustBigInt) -> RustBigInt

Performs the % operation. Read more
Source§

impl Rem for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the % operator.
Source§

fn rem(self, other: RustBigInt) -> RustBigInt

Performs the % operation. Read more
Source§

impl RemAssign<&RustBigInt> for RustBigInt

Source§

fn rem_assign(&mut self, other: &RustBigInt)

Performs the %= operation. Read more
Source§

impl RemAssign for RustBigInt

Source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
Source§

impl<'a, 'b> Sub<&'b RustBigInt> for &'a RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the - operator.
Source§

fn sub(self, other: &RustBigInt) -> RustBigInt

Performs the - operation. Read more
Source§

impl Sub for RustBigInt

Source§

type Output = RustBigInt

The resulting type after applying the - operator.
Source§

fn sub(self, other: RustBigInt) -> RustBigInt

Performs the - operation. Read more
Source§

impl SubAssign<&RustBigInt> for RustBigInt

Source§

fn sub_assign(&mut self, other: &RustBigInt)

Performs the -= operation. Read more
Source§

impl SubAssign for RustBigInt

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl TopDecode for RustBigInt

Source§

fn top_decode<I: TopDecodeInput>(input: I) -> Result<Self, DecodeError>

Attempt to deserialize the value from input.
Source§

fn top_decode_or_exit<I: TopDecodeInput, ExitCtx: Clone>( input: I, _: ExitCtx, _: fn(ExitCtx, DecodeError) -> !, ) -> Self

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller implementations in cases where the application is supposed to exit directly on decode error.
Source§

impl TopEncode for RustBigInt

Source§

fn top_encode<O: TopEncodeOutput>(&self, output: O) -> Result<(), EncodeError>

Attempt to serialize the value to ouput.
Source§

fn top_encode_or_exit<O: TopEncodeOutput, ExitCtx: Clone>( &self, output: O, c: ExitCtx, exit: fn(ExitCtx, EncodeError) -> !, )

Version of top_decode that exits quickly in case of error. Its purpose is to create smaller bytecode implementations in cases where the application is supposed to exit directly on decode error.
Source§

impl TypeAbi for RustBigInt

Source§

fn type_name() -> String

Source§

fn provide_type_descriptions<TDC>(accumulator: &mut TDC)

A type can provide more than its own description. For instance, a struct can also provide the descriptions of the type of its fields. TypeAbi doesn’t care for the exact accumulator type, which is abstracted by the TypeDescriptionContainer trait.
Source§

impl Eq for RustBigInt

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncCallArg for T
where T: TopEncode,

Source§

fn push_async_arg( &self, serializer: &mut HexCallDataSerializer, ) -> Result<(), SCError>

Source§

fn push_async_arg_exact( &self, _serializer: &mut HexCallDataSerializer, _expected_len: usize, ) -> Result<(), SCError>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<I, D, T> DynArg<I, D> for T
where I: TopDecodeInput, D: DynArgInput<I>, T: TopDecode,

Source§

fn dyn_load(loader: &mut D, arg_id: ArgId) -> T

Source§

impl<A, BigInt, BigUint, T> EndpointResult<A, BigInt, BigUint> for T
where T: TopEncode, BigUint: BigUintApi + 'static, BigInt: BigIntApi<BigUint> + 'static, A: ContractHookApi<BigInt, BigUint> + ContractIOApi<BigInt, BigUint> + 'static,

Source§

fn finish(&self, api: A)

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,