Struct miden_objects::transaction::TransactionScript
source · pub struct TransactionScript { /* private fields */ }Expand description
A struct that represents a transaction script.
A transaction script is a program that is executed in a transaction after all input notes have been executed.
The TransactionScript object is composed of:
Implementations§
source§impl TransactionScript
impl TransactionScript
sourcepub fn new<T: IntoIterator<Item = (Word, Vec<Felt>)>>(
code: ProgramAst,
inputs: T,
assembler: &Assembler
) -> Result<(Self, CodeBlock), TransactionScriptError>
pub fn new<T: IntoIterator<Item = (Word, Vec<Felt>)>>( code: ProgramAst, inputs: T, assembler: &Assembler ) -> Result<(Self, CodeBlock), TransactionScriptError>
Returns a new instance of a TransactionScript with the provided script and inputs and the compiled script code block.
§Errors
Returns an error if script compilation fails.
sourcepub fn from_parts<T: IntoIterator<Item = (Word, Vec<Felt>)>>(
code: ProgramAst,
hash: Digest,
inputs: T
) -> Result<Self, TransactionScriptError>
pub fn from_parts<T: IntoIterator<Item = (Word, Vec<Felt>)>>( code: ProgramAst, hash: Digest, inputs: T ) -> Result<Self, TransactionScriptError>
Returns a new instance of a TransactionScript instantiated from the provided components.
Note: this constructor does not verify that a compiled code in fact results in the provided hash.
sourcepub fn code(&self) -> &ProgramAst
pub fn code(&self) -> &ProgramAst
Returns a reference to the code.
Trait Implementations§
source§impl Clone for TransactionScript
impl Clone for TransactionScript
source§fn clone(&self) -> TransactionScript
fn clone(&self) -> TransactionScript
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for TransactionScript
impl Send for TransactionScript
impl Sync for TransactionScript
impl Unpin for TransactionScript
impl UnwindSafe for TransactionScript
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