Type Alias TransactTo

Source
pub type TransactTo = TxKind;
Expand description

Transaction destination

Aliased Type§

enum TransactTo {
    Create,
    Call(Address),
}

Variants§

§

Create

A transaction that creates a contract.

§

Call(Address)

A transaction that calls a contract or transfer.

Implementations

Source§

impl TxKind

Source

pub const fn to(&self) -> Option<&Address>

Returns the address of the contract that will be called or will receive the transfer.

Source

pub const fn into_to(self) -> Option<Address>

Consumes the type and returns the address of the contract that will be called or will receive the transfer.

Source

pub const fn is_create(&self) -> bool

Returns true if the transaction is a contract creation.

Source

pub const fn is_call(&self) -> bool

Returns true if the transaction is a contract call.

Source

pub const fn size(&self) -> usize

Calculates a heuristic for the in-memory size of this object.

Trait Implementations

Source§

impl Clone for TxKind

Source§

fn clone(&self) -> TxKind

Returns a copy 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 Debug for TxKind

Source§

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

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

impl Decodable for TxKind

Source§

fn decode(buf: &mut &[u8]) -> Result<TxKind, Error>

Decodes the blob into the appropriate type. buf must be advanced past the decoded object.
Source§

impl Default for TxKind

Source§

fn default() -> TxKind

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TxKind

Source§

fn deserialize<D>( deserializer: D, ) -> Result<TxKind, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Encodable for TxKind

Source§

fn encode(&self, out: &mut dyn BufMut)

Encodes the type into the out buffer.
Source§

fn length(&self) -> usize

Returns the length of the encoding of this type in bytes. Read more
Source§

impl From<Address> for TxKind

Source§

fn from(value: Address) -> TxKind

Creates a TxKind::Call with the given address.

Source§

impl From<Option<Address>> for TxKind

Source§

fn from(value: Option<Address>) -> TxKind

Creates a TxKind::Call with the Some address, None otherwise.

Source§

impl Hash for TxKind

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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

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

impl PartialEq for TxKind

Source§

fn eq(&self, other: &TxKind) -> 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 Serialize for TxKind

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for TxKind

Source§

impl Eq for TxKind

Source§

impl StructuralPartialEq for TxKind