Trait oasis_contract_sdk::context::Context
source · pub trait Context {
type PublicStore: PublicStore;
type ConfidentialStore: ConfidentialStore;
type Env: Env + Crypto;
// Required methods
fn instance_id(&self) -> InstanceId;
fn instance_address(&self) -> &Address;
fn caller_address(&self) -> &Address;
fn deposited_tokens(&self) -> &[BaseUnits];
fn is_read_only(&self) -> bool;
fn call_format(&self) -> CallFormat;
fn emit_message(&mut self, msg: Message);
fn emit_event<E: Event>(&mut self, event: E);
fn public_store(&mut self) -> &mut Self::PublicStore;
fn confidential_store(&mut self) -> &mut Self::ConfidentialStore;
fn env(&self) -> &Self::Env;
}
Expand description
Execution context.
Required Associated Types§
sourcetype PublicStore: PublicStore
type PublicStore: PublicStore
The public store.
sourcetype ConfidentialStore: ConfidentialStore
type ConfidentialStore: ConfidentialStore
The confidential store.
Required Methods§
sourcefn instance_id(&self) -> InstanceId
fn instance_id(&self) -> InstanceId
Contract instance identifier.
sourcefn instance_address(&self) -> &Address
fn instance_address(&self) -> &Address
Contract instance address.
sourcefn caller_address(&self) -> &Address
fn caller_address(&self) -> &Address
Caller address.
sourcefn deposited_tokens(&self) -> &[BaseUnits]
fn deposited_tokens(&self) -> &[BaseUnits]
Tokens deposited by the caller.
sourcefn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether the call is read-only and must not make any storage modifications.
sourcefn call_format(&self) -> CallFormat
fn call_format(&self) -> CallFormat
Call format.
sourcefn emit_message(&mut self, msg: Message)
fn emit_message(&mut self, msg: Message)
Emits a message.
sourcefn emit_event<E: Event>(&mut self, event: E)
fn emit_event<E: Event>(&mut self, event: E)
Emits an event.
sourcefn public_store(&mut self) -> &mut Self::PublicStore
fn public_store(&mut self) -> &mut Self::PublicStore
Public contract store.
sourcefn confidential_store(&mut self) -> &mut Self::ConfidentialStore
fn confidential_store(&mut self) -> &mut Self::ConfidentialStore
Confidential contract store.
Object Safety§
This trait is not object safe.