pub struct RuntimeResourceMeter { /* private fields */ }Expand description
Tracks resource consumption (signature operations and pushed bytes, both expressed as script units) during script execution against a committed budget.
Implementations§
Source§impl RuntimeResourceMeter
impl RuntimeResourceMeter
pub fn new_script_units( sigop_script_units: ScriptUnits, script_units_limit: ScriptUnits, ) -> Self
pub fn used_sig_ops(&self) -> u16
pub fn used_script_units(&self) -> ScriptUnits
pub fn consume_script_units( &mut self, units: ScriptUnits, ) -> Result<(), TxScriptError>
pub fn consume_sig_op_cost(&mut self, count: u16) -> Result<(), TxScriptError>
pub fn charge_newly_pushed_bytes( &mut self, pushed_bytes_delta: u64, ) -> Result<(), TxScriptError>
Trait Implementations§
Source§impl Clone for RuntimeResourceMeter
impl Clone for RuntimeResourceMeter
Auto Trait Implementations§
impl Freeze for RuntimeResourceMeter
impl RefUnwindSafe for RuntimeResourceMeter
impl Send for RuntimeResourceMeter
impl Sync for RuntimeResourceMeter
impl Unpin for RuntimeResourceMeter
impl UnsafeUnpin for RuntimeResourceMeter
impl UnwindSafe for RuntimeResourceMeter
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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