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
Current context is a script execution.
Call
Current context is under a CALL
scope
NotInitialized
No transaction initialized/invalid context.
Implementations§
source§impl 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§
source§impl PartialEq<Context> for Context
impl PartialEq<Context> for Context
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§
source§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying type as
Any
.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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more