pub struct ScriptContext { /* private fields */ }Expand description
Contextual data for use in Tari scripts. The context will typically be unambiguously and deterministically populated by nodes that are executing the script.
Implementations§
Source§impl ScriptContext
impl ScriptContext
pub fn new( height: u64, prev_hash: &HashValue, com: &CompressedPedersenCommitment, ) -> Self
pub fn block_height(&self) -> u64
pub fn prev_block_hash(&self) -> &HashValue
pub fn commitment(&self) -> &CompressedPedersenCommitment
Trait Implementations§
Source§impl Clone for ScriptContext
impl Clone for ScriptContext
Source§fn clone(&self) -> ScriptContext
fn clone(&self) -> ScriptContext
Returns a duplicate 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 moreSource§impl Debug for ScriptContext
impl Debug for ScriptContext
Source§impl Default for ScriptContext
impl Default for ScriptContext
Source§fn default() -> ScriptContext
fn default() -> ScriptContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ScriptContext
impl RefUnwindSafe for ScriptContext
impl Send for ScriptContext
impl Sync for ScriptContext
impl Unpin for ScriptContext
impl UnwindSafe for ScriptContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more