Struct fuel_vm::transactor::Transactor
source · [−]pub struct Transactor<S, Tx> { /* private fields */ }
Expand description
State machine to execute transactions and provide runtime entities on demand.
Builder pattern for Interpreter
. Follows the recommended Non-consuming builder
.
Based on https://doc.rust-lang.org/1.5.0/style/ownership/builders.html#non-consuming-builders-preferred
Implementations
sourceimpl<'a, S, Tx> Transactor<S, Tx>where
Tx: ExecutableTransaction,
impl<'a, S, Tx> Transactor<S, Tx>where
Tx: ExecutableTransaction,
sourcepub fn new(storage: S, params: ConsensusParameters) -> Self
pub fn new(storage: S, params: ConsensusParameters) -> Self
Transactor constructor
sourcepub fn state_transition(&'a self) -> Option<StateTransitionRef<'a, Tx>>
pub fn state_transition(&'a self) -> Option<StateTransitionRef<'a, Tx>>
State transition representation after the execution of a transaction.
Will be None
if the last transaction resulted in a VM panic, or if no
transaction was executed.
sourcepub fn to_owned_state_transition(&self) -> Option<StateTransition<Tx>>
pub fn to_owned_state_transition(&self) -> Option<StateTransition<Tx>>
State transition representation after the execution of a transaction.
Will be None
if the last transaction resulted in a VM panic, or if no
transaction was executed.
sourcepub const fn error(&self) -> Option<&InterpreterError>
pub const fn error(&self) -> Option<&InterpreterError>
Interpreter error representation after the execution of a transaction.
Follows the same criteria as Self::state_transition
to return
None
.
Will be None
if the last transaction resulted successful, or if no
transaction was executed.
sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Returns true if last transaction execution was successful
sourcepub fn result(
&'a self
) -> Result<StateTransitionRef<'a, Tx>, &'_ InterpreterError>
pub fn result(
&'a self
) -> Result<StateTransitionRef<'a, Tx>, &'_ InterpreterError>
Result representation of the last executed transaction.
Will return None
if no transaction was executed.
sourcepub fn interpreter(self) -> Interpreter<S, Tx>
pub fn interpreter(self) -> Interpreter<S, Tx>
Convert this transaction into the underlying VM instance.
This isn’t a two-way operation since if you convert this instance into the raw VM, then you lose the transactor state.
sourcepub const fn params(&self) -> &ConsensusParameters
pub const fn params(&self) -> &ConsensusParameters
Consensus parameters
sourceimpl<'a, S> Transactor<S, Script>
impl<'a, S> Transactor<S, Script>
sourceimpl<S, Tx> Transactor<S, Tx>where
S: InterpreterStorage,
impl<S, Tx> Transactor<S, Tx>where
S: InterpreterStorage,
sourceimpl<S, Tx> Transactor<S, Tx>where
S: InterpreterStorage,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
impl<S, Tx> Transactor<S, Tx>where
S: InterpreterStorage,
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
Trait Implementations
sourceimpl<S, Tx> AsMut<S> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
impl<S, Tx> AsMut<S> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
sourceimpl<S, Tx> AsRef<Interpreter<S, Tx>> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
impl<S, Tx> AsRef<Interpreter<S, Tx>> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
sourcefn as_ref(&self) -> &Interpreter<S, Tx>
fn as_ref(&self) -> &Interpreter<S, Tx>
sourceimpl<S, Tx> AsRef<S> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
impl<S, Tx> AsRef<S> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
sourceimpl<S: Debug, Tx: Debug> Debug for Transactor<S, Tx>
impl<S: Debug, Tx: Debug> Debug for Transactor<S, Tx>
sourceimpl<S, Tx> Default for Transactor<S, Tx>where
S: Default,
Tx: ExecutableTransaction,
impl<S, Tx> Default for Transactor<S, Tx>where
S: Default,
Tx: ExecutableTransaction,
sourceimpl<S, Tx> From<Interpreter<S, Tx>> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
impl<S, Tx> From<Interpreter<S, Tx>> for Transactor<S, Tx>where
Tx: ExecutableTransaction,
sourcefn from(interpreter: Interpreter<S, Tx>) -> Self
fn from(interpreter: Interpreter<S, Tx>) -> Self
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
sourceimpl<S, Tx> From<Transactor<S, Tx>> for Interpreter<S, Tx>where
Tx: ExecutableTransaction,
impl<S, Tx> From<Transactor<S, Tx>> for Interpreter<S, Tx>where
Tx: ExecutableTransaction,
sourcefn from(transactor: Transactor<S, Tx>) -> Self
fn from(transactor: Transactor<S, Tx>) -> Self
Auto Trait Implementations
impl<S, Tx> !RefUnwindSafe for Transactor<S, Tx>
impl<S, Tx> Send for Transactor<S, Tx>where
S: Send,
Tx: Send,
impl<S, Tx> Sync for Transactor<S, Tx>where
S: Sync,
Tx: Sync,
impl<S, Tx> Unpin for Transactor<S, Tx>where
S: Unpin,
Tx: Unpin,
impl<S, Tx> !UnwindSafe for Transactor<S, Tx>
Blanket Implementations
impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<'a, T> StorageAsMut for T
impl<'a, T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
sourceimpl<'a, T> StorageAsRef for T
impl<'a, T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
sourceimpl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere
T: AsRef<[u8]>,
sourcefn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read moresourcefn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more