pub enum CallStackElement {
    Session {
        account_hash: AccountHash,
    },
    StoredSession {
        account_hash: AccountHash,
        contract_package_hash: ContractPackageHash,
        contract_hash: ContractHash,
    },
    StoredContract {
        contract_package_hash: ContractPackageHash,
        contract_hash: ContractHash,
    },
}
Expand description

Represents the origin of a sub-call.

Variants§

§

Session

Fields

§account_hash: AccountHash

The account hash of the caller

Session

§

StoredSession

Fields

§account_hash: AccountHash

The account hash of the caller

§contract_package_hash: ContractPackageHash

The contract package hash

§contract_hash: ContractHash

The contract hash

Effectively an EntryPointType::Session - stored access to a session.

§

StoredContract

Fields

§contract_package_hash: ContractPackageHash

The contract package hash

§contract_hash: ContractHash

The contract hash

Contract

Implementations§

source§

impl CallStackElement

source

pub fn session(account_hash: AccountHash) -> Self

Creates a CallStackElement::Session. This represents a call into session code, and should only ever happen once in a call stack.

source

pub fn stored_contract( contract_package_hash: ContractPackageHash, contract_hash: ContractHash ) -> Self

Creates a ['CallStackElement::StoredContract]. This represents a call into a contract with EntryPointType::Contract.

source

pub fn stored_session( account_hash: AccountHash, contract_package_hash: ContractPackageHash, contract_hash: ContractHash ) -> Self

Creates a ['CallStackElement::StoredSession]. This represents a call into a contract with EntryPointType::Session.

source

pub fn tag(&self) -> CallStackElementTag

Gets the tag from self.

source

pub fn contract_hash(&self) -> Option<&ContractHash>

Gets the ContractHash for both stored session and stored contract variants.

Trait Implementations§

source§

impl CLTyped for CallStackElement

source§

fn cl_type() -> CLType

The CLType of Self.
source§

impl Clone for CallStackElement

source§

fn clone(&self) -> CallStackElement

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 CallStackElement

source§

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

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

impl FromBytes for CallStackElement

source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Deserializes the slice into Self.
source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Deserializes the Vec<u8> into Self.
source§

impl PartialEq for CallStackElement

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToBytes for CallStackElement

source§

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serializes &self to a Vec<u8>.
source§

fn serialized_length(&self) -> usize

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap.
source§

fn into_bytes(self) -> Result<Vec<u8>, Error>where Self: Sized,

Consumes self and serializes to a Vec<u8>.
source§

fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>

Writes &self into a mutable writer.
source§

impl Eq for CallStackElement

source§

impl StructuralEq for CallStackElement

source§

impl StructuralPartialEq for CallStackElement

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.