Struct fuel_vm::memory_client::MemoryClient
source · [−]pub struct MemoryClient<'a> { /* private fields */ }
Expand description
Client implementation with in-memory storage backend.
Implementations
sourceimpl<'a> MemoryClient<'a>
impl<'a> MemoryClient<'a>
sourcepub fn new(storage: MemoryStorage, params: ConsensusParameters) -> Self
pub fn new(storage: MemoryStorage, params: ConsensusParameters) -> Self
Create a new instance of the memory client out of a provided storage.
sourcepub fn from_txtor(transactor: Transactor<'a, MemoryStorage>) -> Self
pub fn from_txtor(transactor: Transactor<'a, MemoryStorage>) -> Self
Create a new instance of the memory client out of a provided storage.
sourcepub fn backtrace(&self) -> Option<Backtrace>
pub fn backtrace(&self) -> Option<Backtrace>
If a transaction was executed and produced a VM panic, returns the
backtrace; return None
otherwise.
sourcepub fn receipts(&self) -> Option<&[Receipt]>
pub fn receipts(&self) -> Option<&[Receipt]>
If a transaction was successfully executed, returns the produced
receipts; return None
otherwise.
sourcepub const fn state_transition(&self) -> Option<&StateTransitionRef<'_>>
pub const fn state_transition(&self) -> Option<&StateTransitionRef<'_>>
State transition representation after the execution of a transaction.
sourcepub fn transact(&mut self, tx: CheckedTransaction) -> &[Receipt]
pub fn transact(&mut self, tx: CheckedTransaction) -> &[Receipt]
Execute a transaction.
Since the memory storage is Infallible
, associatively, the memory
client should also be.
sourcepub fn persist(&mut self)
pub fn persist(&mut self)
Persist the changes caused by Self::transact
.
sourcepub const fn params(&self) -> &ConsensusParameters
pub const fn params(&self) -> &ConsensusParameters
Consensus parameters
Trait Implementations
sourceimpl<'a> AsMut<MemoryStorage> for MemoryClient<'a>
impl<'a> AsMut<MemoryStorage> for MemoryClient<'a>
sourcefn as_mut(&mut self) -> &mut MemoryStorage
fn as_mut(&mut self) -> &mut MemoryStorage
Converts this type into a mutable reference of the (usually inferred) input type.
sourceimpl<'a> AsRef<MemoryStorage> for MemoryClient<'a>
impl<'a> AsRef<MemoryStorage> for MemoryClient<'a>
sourcefn as_ref(&self) -> &MemoryStorage
fn as_ref(&self) -> &MemoryStorage
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<'a> Debug for MemoryClient<'a>
impl<'a> Debug for MemoryClient<'a>
sourceimpl<'a> Default for MemoryClient<'a>
impl<'a> Default for MemoryClient<'a>
sourcefn default() -> MemoryClient<'a>
fn default() -> MemoryClient<'a>
Returns the “default value” for a type. Read more
sourceimpl<'a> From<MemoryClient<'a>> for Transactor<'a, MemoryStorage>
impl<'a> From<MemoryClient<'a>> for Transactor<'a, MemoryStorage>
sourcefn from(client: MemoryClient<'a>) -> Self
fn from(client: MemoryClient<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<MemoryStorage> for MemoryClient<'a>
impl<'a> From<MemoryStorage> for MemoryClient<'a>
sourcefn from(s: MemoryStorage) -> Self
fn from(s: MemoryStorage) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for MemoryClient<'a>
impl<'a> Send for MemoryClient<'a>
impl<'a> Sync for MemoryClient<'a>
impl<'a> Unpin for MemoryClient<'a>
impl<'a> !UnwindSafe for MemoryClient<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more