pub struct Context<'a> { /* private fields */ }Expand description
Context wraps a single message request (and possibly response as well) along with the router callbacks necessary for making nested message calls.
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn new(
context_info: ContextInfo,
host_callbacks: &'a dyn HostBackend,
) -> Self
pub fn new( context_info: ContextInfo, host_callbacks: &'a dyn HostBackend, ) -> Self
Create a new context from a message packet and host callbacks.
sourcepub fn account_id(&self) -> AccountID
pub fn account_id(&self) -> AccountID
This is the address of the account that is getting called. In a receiving account, this is the account’s own address.
sourcepub fn caller(&self) -> AccountID
pub fn caller(&self) -> AccountID
This is the address of the account which is making the message call.
sourcepub unsafe fn host_backend(&self) -> &dyn HostBackend
pub unsafe fn host_backend(&self) -> &dyn HostBackend
Get the host backend.
sourcepub fn memory_manager(&self) -> &MemoryManager
pub fn memory_manager(&self) -> &MemoryManager
Get the memory manager.
Auto Trait Implementations§
impl<'a> !Freeze for Context<'a>
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> !Send for Context<'a>
impl<'a> !Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more