pub struct ExternContext<T: ContextType> { /* private fields */ }
Expand description

Context backed by host functions.

Usuaully referred to via aliases InitContext or ReceiveContext.

Trait Implementations§

source§

impl<T: Default + ContextType> Default for ExternContext<T>

source§

fn default() -> ExternContext<T>

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

impl<T: ContextType> HasCommonData for ExternContext<T>

§

type MetadataType = ExternChainMeta

§

type ParamType = ExternParameter

§

type PolicyIteratorType = PoliciesIterator

§

type PolicyType = Policy<AttributesCursor>

source§

fn metadata(&self) -> &Self::MetadataType

Get the reference to chain metadata
source§

fn policies(&self) -> PoliciesIterator

Policies of the sender of the message. For init methods this is the would-be creator of the contract, for the receive this is the policies of the immediate sender. Read more
source§

fn parameter_cursor(&self) -> Self::ParamType

Get the cursor to the parameter.
source§

impl HasInitContext for ExternContext<ExternInitContext>

§Trait implementations for the init context

source§

fn open(_: Self::InitData) -> Self

Create a new init context by using an external call.

§

type InitData = ()

Data needed to open the context.
source§

fn init_origin(&self) -> AccountAddress

Who invoked this init call.
source§

impl HasReceiveContext for ExternContext<ExternReceiveContext>

§Trait implementations for the receive context

source§

fn open(_: Self::ReceiveData) -> Self

Create a new receive context

§

type ReceiveData = ()

source§

fn invoker(&self) -> AccountAddress

Who is the account that initiated the top-level transaction this invocation is a part of.
source§

fn self_address(&self) -> ContractAddress

The address of the contract being invoked.
source§

fn sender(&self) -> Address

The immediate sender of the message. In general different from the invoker.
source§

fn owner(&self) -> AccountAddress

Account which created the contract instance.
source§

fn named_entrypoint(&self) -> OwnedEntrypointName

Get the name of the entrypoint that was named. In case a default entrypoint is invoked this can be different from the name of the entrypoint that is being executed.

Auto Trait Implementations§

§

impl<T> Freeze for ExternContext<T>

§

impl<T> RefUnwindSafe for ExternContext<T>
where T: RefUnwindSafe,

§

impl<T> Send for ExternContext<T>
where T: Send,

§

impl<T> Sync for ExternContext<T>
where T: Sync,

§

impl<T> Unpin for ExternContext<T>
where T: Unpin,

§

impl<T> UnwindSafe for ExternContext<T>
where T: UnwindSafe,

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> 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> 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, U> TryFrom<U> for T
where 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 T
where 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.