Struct fuel_vm::memory_client::MemoryClient
source · [−]pub struct MemoryClient { /* private fields */ }
Expand description
Client implementation with in-memory storage backend.
Implementations
sourceimpl 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
sourceimpl<'a> AsMut<MemoryStorage> for MemoryClient
impl<'a> AsMut<MemoryStorage> for MemoryClient
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
impl<'a> AsRef<MemoryStorage> for MemoryClient
sourcefn as_ref(&self) -> &MemoryStorage
fn as_ref(&self) -> &MemoryStorage
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Debug for MemoryClient
impl Debug for MemoryClient
sourceimpl Default for MemoryClient
impl Default for MemoryClient
sourcefn default() -> MemoryClient
fn default() -> MemoryClient
Returns the “default value” for a type. Read more
sourceimpl<'a> From<MemoryClient> for Transactor<MemoryStorage, Script>
impl<'a> From<MemoryClient> for Transactor<MemoryStorage, Script>
sourcefn from(client: MemoryClient) -> Self
fn from(client: MemoryClient) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<MemoryStorage> for MemoryClient
impl<'a> From<MemoryStorage> for MemoryClient
sourcefn from(s: MemoryStorage) -> Self
fn from(s: MemoryStorage) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for MemoryClient
impl Send for MemoryClient
impl Sync for MemoryClient
impl Unpin for MemoryClient
impl !UnwindSafe for MemoryClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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