pub struct ActionLog<'a, S: Db> { /* private fields */ }Expand description
The ActionLog records all actions that were successfully executed by the contract.
Since the action is fed into the contract as json-encoded bytes, we record exactly the raw json-bytes here,
and not the CallAction object. This allows us to efficiently give out the json object,
because instead of deserializing and then serializing it back to json, we can directly copy the json data after deserialization.
Implementations§
Source§impl<'a, S: Db> ActionLog<'a, S>
impl<'a, S: Db> ActionLog<'a, S>
Sourcepub fn new(db: &'a S, cid: ContractId) -> Self
pub fn new(db: &'a S, cid: ContractId) -> Self
Opens (or creates) the action log
pub fn get_tx_action_paginated( &self, pagination: Pagination, ) -> Result<Option<PaginatedElements<TxAction>>>
Sourcepub fn last(&self) -> Result<Option<ActionRecord>>
pub fn last(&self) -> Result<Option<ActionRecord>>
Retrieves the last action record
pub fn len(&self) -> Result<u64>
pub fn is_empty(&self) -> Result<bool>
Auto Trait Implementations§
impl<'a, S> Freeze for ActionLog<'a, S>
impl<'a, S> RefUnwindSafe for ActionLog<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for ActionLog<'a, S>
impl<'a, S> Sync for ActionLog<'a, S>
impl<'a, S> Unpin for ActionLog<'a, S>
impl<'a, S> UnsafeUnpin for ActionLog<'a, S>
impl<'a, S> UnwindSafe for ActionLog<'a, S>where
S: RefUnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more