Struct elrond_wasm::types::Address[][src]

pub struct Address(_);
Expand description

An Address is just a H256 with a different name. Has a different ABI name than H256.

Implementations

impl Address[src]

pub fn from_slice(slice: &[u8]) -> Self[src]

impl Address[src]

pub fn zero() -> Self[src]

Returns a new address of 32 zeros. Allocates directly in heap. Minimal resulting wasm code (14 bytes if not inlined).

pub fn len_bytes() -> usize[src]

Returns the size of an address in bytes.

pub fn as_bytes(&self) -> &[u8][src]

Extracts a byte slice containing the entire fixed hash.

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

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

pub fn as_ptr(&mut self) -> *const u8[src]

Pointer to the data on the heap.

pub fn as_mut_ptr(&mut self) -> *mut u8[src]

Returns an unsafe mutable pointer to the data on the heap. Used by the API to populate data.

pub fn is_zero(&self) -> bool[src]

True if all 32 bytes of the hash are zero.

pub fn into_boxed_bytes(self) -> BoxedBytes[src]

Transmutes self to an (in principle) variable length boxed bytes object. Both BoxedBytes and H256 keep the data on the heap, so only the pointer to that data needs to be transmuted. Does not reallocate or copy data, the data on the heap remains untouched.

Trait Implementations

impl AsMut<[u8]> for Address[src]

fn as_mut(&mut self) -> &mut [u8][src]

Performs the conversion.

impl AsRef<[u8]> for Address[src]

fn as_ref(&self) -> &[u8][src]

Performs the conversion.

impl Clone for Address[src]

fn clone(&self) -> Address[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Address[src]

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

Formats the value using the given formatter. Read more

impl<'a> From<&'a [u8; 32]> for Address[src]

fn from(bytes: &'a [u8; 32]) -> Self[src]

Performs the conversion.

impl<'a> From<&'a Address> for &'a H256[src]

fn from(address: &'a Address) -> Self[src]

Performs the conversion.

impl<'a> From<&'a mut [u8; 32]> for Address[src]

fn from(bytes: &'a mut [u8; 32]) -> Self[src]

Performs the conversion.

impl From<[u8; 32]> for Address[src]

fn from(arr: [u8; 32]) -> Self[src]

Performs the conversion.

impl From<Address> for H256[src]

fn from(address: Address) -> Self[src]

Performs the conversion.

impl From<Box<[u8; 32], Global>> for Address[src]

fn from(bytes: Box<[u8; 32]>) -> Self[src]

Performs the conversion.

impl From<H256> for Address[src]

fn from(hash: H256) -> Self[src]

Performs the conversion.

impl Hash for Address[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl NestedDecode for Address[src]

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

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. Read more

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

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. Read more

impl NestedEncode for Address[src]

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

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

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

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. Read more

impl PartialEq<Address> for Address[src]

fn eq(&self, other: &Address) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Address) -> bool[src]

This method tests for !=.

impl TopDecode for Address[src]

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

Attempt to deserialize the value from input.

fn top_decode_or_exit<I: TopDecodeInput, ExitCtx: Clone>(
    input: I,
    c: ExitCtx,
    exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> Self
[src]

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. Read more

impl TopEncode for Address[src]

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

Attempt to serialize the value to ouput.

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

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. Read more

impl TypeAbi for Address[src]

fn type_name() -> String[src]

fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
    accumulator: &mut TDC
)
[src]

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. Read more

impl Eq for Address[src]

impl StructuralEq for Address[src]

impl StructuralPartialEq for Address[src]

Auto Trait Implementations

impl Send for Address

impl Sync for Address

impl Unpin for Address

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> CallHasher for T where
    T: Hash

pub fn get_hash<H>(&self, hasher: H) -> u64 where
    H: Hasher

impl<T> ContractCallArg for T where
    T: TopEncode
[src]

pub fn push_async_arg(&Self, &mut ArgBuffer) -> Result<(), SCError>[src]

impl<T> DynArg for T where
    T: TopDecode
[src]

pub fn dyn_load<I, D>(&mut D, ArgId) -> T where
    I: TopDecodeInput,
    D: DynArgInput<I>, 
[src]

impl<T> EndpointResult for T where
    T: TopEncode
[src]

type DecodeAs = T

Indicates how the result of the endpoint can be interpreted when called via proxy. Self for most types. Read more

pub fn finish<FA>(&Self, FA) where
    FA: EndpointFinishApi + Clone + 'static, 
[src]

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.