pub struct ServiceContext { /* private fields */ }
Implementations§
Source§impl ServiceContext
impl ServiceContext
pub fn new(params: ServiceContextParams) -> Self
pub fn with_context( context: &ServiceContext, service_name: String, service_method: String, service_payload: String, ) -> Self
pub fn get_events(&self) -> Vec<Event>
pub fn sub_cycles(&self, cycles: u64) -> ProtocolResult<()>
pub fn get_cycles_price(&self) -> u64
pub fn get_cycles_limit(&self) -> u64
pub fn get_cycles_used(&self) -> u64
pub fn get_caller(&self) -> Address
pub fn get_current_epoch_id(&self) -> u64
pub fn get_service_name(&self) -> &str
pub fn get_service_method(&self) -> &str
pub fn get_payload(&self) -> &str
pub fn get_timestamp(&self) -> u64
pub fn emit_event(&self, message: String) -> ProtocolResult<()>
Trait Implementations§
Source§impl Clone for ServiceContext
impl Clone for ServiceContext
Source§fn clone(&self) -> ServiceContext
fn clone(&self) -> ServiceContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServiceContext
impl Debug for ServiceContext
Source§impl PartialEq for ServiceContext
impl PartialEq for ServiceContext
impl StructuralPartialEq for ServiceContext
Auto Trait Implementations§
impl Freeze for ServiceContext
impl !RefUnwindSafe for ServiceContext
impl !Send for ServiceContext
impl !Sync for ServiceContext
impl Unpin for ServiceContext
impl !UnwindSafe for ServiceContext
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