pub struct Budget(_);

Implementations§

source§

impl Budget

source

pub fn charge(&self, ty: CostType, input: u64) -> Result<(), HostError>

source

pub fn get_input(&self, ty: CostType) -> u64

source

pub fn get_cpu_insns_count(&self) -> u64

source

pub fn get_mem_bytes_count(&self) -> u64

source

pub fn reset_default(&self)

source

pub fn reset_unlimited(&self)

source

pub fn reset_unlimited_cpu(&self)

source

pub fn reset_unlimited_mem(&self)

source

pub fn reset_inputs(&self)

Trait Implementations§

source§

impl AsBudget for Budget

source§

impl Clone for Budget

source§

fn clone(&self) -> Budget

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Compare<&[u8]> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &&[u8], b: &&[u8]) -> Result<Ordering, Self::Error>

source§

impl<const N: usize> Compare<[u8; N]> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &[u8; N], b: &[u8; N]) -> Result<Ordering, Self::Error>

source§

impl Compare<AccessType> for Budget

source§

impl Compare<AccountEntry> for Budget

source§

impl Compare<AccountId> for Budget

source§

impl Compare<ClaimableBalanceEntry> for Budget

source§

impl Compare<ConfigSettingEntry> for Budget

source§

impl Compare<ContractCodeEntry> for Budget

source§

impl Compare<DataEntry> for Budget

source§

impl Compare<Hash> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &Hash, b: &Hash) -> Result<Ordering, Self::Error>

source§

impl Compare<LedgerEntry> for Budget

source§

impl Compare<LedgerEntryData> for Budget

source§

impl Compare<LedgerEntryExt> for Budget

source§

impl Compare<LedgerKey> for Budget

source§

impl Compare<LedgerKeyAccount> for Budget

source§

impl Compare<LedgerKeyClaimableBalance> for Budget

source§

impl Compare<LedgerKeyConfigSetting> for Budget

source§

impl Compare<LedgerKeyContractCode> for Budget

source§

impl Compare<LedgerKeyData> for Budget

source§

impl Compare<LedgerKeyLiquidityPool> for Budget

source§

impl Compare<LedgerKeyOffer> for Budget

source§

impl Compare<LedgerKeyTrustLine> for Budget

source§

impl Compare<LiquidityPoolEntry> for Budget

source§

impl<K, V> Compare<MeteredOrdMap<K, V, Budget>> for Budgetwhere
K: MeteredClone,
V: MeteredClone,
Budget: Compare<K, Error = HostError> + Compare<V, Error = HostError>,

§

type Error = HostError

source§

fn compare(
&self,
a: &MeteredOrdMap<K, V, Budget>,
b: &MeteredOrdMap<K, V, Budget>
) -> Result<Ordering, Self::Error>

source§

impl<Elt: MeteredClone> Compare<MeteredVector<Elt>> for Budgetwhere
Budget: Compare<Elt, Error = HostError>,

§

type Error = HostError

source§

fn compare(
&self,
a: &MeteredVector<Elt>,
b: &MeteredVector<Elt>
) -> Result<Ordering, Self::Error>

source§

impl Compare<OfferEntry> for Budget

source§

impl Compare<PublicKey> for Budget

source§

impl Compare<ScAddress> for Budget

source§

impl Compare<ScContractCode> for Budget

source§

impl Compare<ScMap> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &ScMap, b: &ScMap) -> Result<Ordering, Self::Error>

source§

impl Compare<ScVal> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &ScVal, b: &ScVal) -> Result<Ordering, Self::Error>

source§

impl Compare<ScVec> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &ScVec, b: &ScVec) -> Result<Ordering, Self::Error>

source§

impl Compare<Static> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &Static, b: &Static) -> Result<Ordering, Self::Error>

source§

impl Compare<Status> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &Status, b: &Status) -> Result<Ordering, Self::Error>

source§

impl Compare<Symbol> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &Symbol, b: &Symbol) -> Result<Ordering, Self::Error>

source§

impl Compare<TrustLineAsset> for Budget

source§

impl Compare<TrustLineEntry> for Budget

source§

impl Compare<Uint256> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &Uint256, b: &Uint256) -> Result<Ordering, Self::Error>

source§

impl Compare<bool> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &bool, b: &bool) -> Result<Ordering, Self::Error>

source§

impl Compare<i128> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &i128, b: &i128) -> Result<Ordering, Self::Error>

source§

impl Compare<i32> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &i32, b: &i32) -> Result<Ordering, Self::Error>

source§

impl Compare<i64> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &i64, b: &i64) -> Result<Ordering, Self::Error>

source§

impl Compare<u128> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &u128, b: &u128) -> Result<Ordering, Self::Error>

source§

impl Compare<u32> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &u32, b: &u32) -> Result<Ordering, Self::Error>

source§

impl Compare<u64> for Budget

§

type Error = HostError

source§

fn compare(&self, a: &u64, b: &u64) -> Result<Ordering, Self::Error>

source§

impl Debug for Budget

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Budget

source§

fn default() -> Budget

Returns the “default value” for a type. Read more
source§

impl Ord for Budget

source§

fn cmp(&self, other: &Budget) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere
Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere
Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<Budget> for Budget

source§

fn eq(&self, other: &Budget) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Budget> for Budget

source§

fn partial_cmp(&self, other: &Budget) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for Budget

source§

impl StructuralEq for Budget

source§

impl StructuralPartialEq for Budget

Auto Trait Implementations§

§

impl !RefUnwindSafe for Budget

§

impl !Send for Budget

§

impl !Sync for Budget

§

impl Unpin for Budget

§

impl !UnwindSafe for Budget

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, C> Compare<&T> for Cwhere
C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(&self, a: &&T, b: &&T) -> Result<Ordering, <C as Compare<&T>>::Error>

source§

impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,

§

type Error = E

source§

fn compare(
&self,
a: &(T, U, V),
b: &(T, U, V)
) -> Result<Ordering, <C as Compare<(T, U, V)>>::Error>

source§

impl<T, U, E, C> Compare<(T, U)> for Cwhere
C: Compare<T, Error = E, Error = E> + Compare<U>,

§

type Error = E

source§

fn compare(
&self,
a: &(T, U),
b: &(T, U)
) -> Result<Ordering, <C as Compare<(T, U)>>::Error>

source§

impl<T, C> Compare<Box<T, Global>> for Cwhere
C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(
&self,
a: &Box<T, Global>,
b: &Box<T, Global>
) -> Result<Ordering, <C as Compare<Box<T, Global>>>::Error>

source§

impl<T, C> Compare<Option<T>> for Cwhere
C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(
&self,
a: &Option<T>,
b: &Option<T>
) -> Result<Ordering, <C as Compare<Option<T>>>::Error>

source§

impl<T, C> Compare<Rc<T>> for Cwhere
C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(
&self,
a: &Rc<T>,
b: &Rc<T>
) -> Result<Ordering, <C as Compare<Rc<T>>>::Error>

source§

impl<T, C> Compare<Vec<T, Global>> for Cwhere
C: Compare<T>,

§

type Error = <C as Compare<T>>::Error

source§

fn compare(
&self,
a: &Vec<T, Global>,
b: &Vec<T, Global>
) -> Result<Ordering, <C as Compare<Vec<T, Global>>>::Error>

§

impl<T> Downcast for Twhere
T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere
T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<E, T, U> TryIntoVal<E, T> for Uwhere
E: Env,
T: TryFromVal<E, U>,

§

type Error = <T as TryFromVal<E, U>>::Error

source§

fn try_into_val(&self, env: &E) -> Result<T, <U as TryIntoVal<E, T>>::Error>

§

impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,

§

fn vzip(self) -> V