pub enum Context {
Predicate {
program: RuntimePredicate,
},
Script {
block_height: u32,
},
Call {
block_height: u32,
},
NotInitialized,
}
Expand description
Runtime context description.
Variants
Predicate
Fields
program: RuntimePredicate
Predicate program to be executed
Current context is a predicate verification.
Script
Fields
block_height: u32
Block height of the context
Current context is a script execution.
Call
Fields
block_height: u32
Block height of the context
Current context is under a CALL
scop.e
NotInitialized
No transaction initialized/invalid context.
Implementations
sourceimpl Context
impl Context
sourcepub const fn is_predicate(&self) -> bool
pub const fn is_predicate(&self) -> bool
Check if the context is predicate
sourcepub const fn is_external(&self) -> bool
pub const fn is_external(&self) -> bool
Return true
if the context is external; false
otherwise.
sourcepub const fn predicate(&self) -> Option<&RuntimePredicate>
pub const fn predicate(&self) -> Option<&RuntimePredicate>
Return the program to be executed, if its a predicate
sourcepub const fn block_height(&self) -> Option<u32>
pub const fn block_height(&self) -> Option<u32>
Return the block height from the context, if either script or call
sourcepub fn update_from_frame_pointer(&mut self, fp: Word)
pub fn update_from_frame_pointer(&mut self, fp: Word)
Update the context according to the provided frame pointer
Trait Implementations
impl Eq for Context
impl StructuralEq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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