Struct fuel_vm::memory_client::MemoryClient
source · pub struct MemoryClient { /* private fields */ }
Expand description
Client implementation with in-memory storage backend.
Implementations§
source§impl MemoryClient
impl MemoryClient
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<MemoryStorage, Script>) -> Self
pub fn from_txtor(transactor: Transactor<MemoryStorage, Script>) -> 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 fn state_transition(&self) -> Option<StateTransitionRef<'_, Script>>
pub fn state_transition(&self) -> Option<StateTransitionRef<'_, Script>>
State transition representation after the execution of a transaction.
sourcepub fn transact(&mut self, tx: Checked<Script>) -> &[Receipt]
pub fn transact(&mut self, tx: Checked<Script>) -> &[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§
source§impl AsMut<MemoryStorage> for MemoryClient
impl AsMut<MemoryStorage> for MemoryClient
source§fn 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.
source§impl AsRef<MemoryStorage> for MemoryClient
impl AsRef<MemoryStorage> for MemoryClient
source§fn as_ref(&self) -> &MemoryStorage
fn as_ref(&self) -> &MemoryStorage
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Debug for MemoryClient
impl Debug for MemoryClient
source§impl Default for MemoryClient
impl Default for MemoryClient
source§fn default() -> MemoryClient
fn default() -> MemoryClient
Returns the “default value” for a type. Read more
source§impl From<MemoryClient> for Transactor<MemoryStorage, Script>
impl From<MemoryClient> for Transactor<MemoryStorage, Script>
source§fn from(client: MemoryClient) -> Self
fn from(client: MemoryClient) -> Self
Converts to this type from the input type.
source§impl From<MemoryStorage> for MemoryClient
impl From<MemoryStorage> for MemoryClient
source§fn from(s: MemoryStorage) -> Self
fn from(s: MemoryStorage) -> Self
Converts to this type from the input type.