Struct vapcore_builtin::Builtin[][src]

pub struct Builtin { /* fields omitted */ }

Pricing scheme, execution definition, and activation block for a built-in contract.

Call cost to compute cost for the given input, execute to execute the contract on the given input, and is_active to determine whether the contract is active.

Implementations

impl Builtin[src]

pub fn cost(&self, input: &[u8], at: u64) -> U256[src]

Simple forwarder for cost.

Return the cost of the most recently activated pricer at the current block number.

If no pricer is actived zero is returned

If multiple activation_at has the same block number the last one is used (follows BTreeMap semantics).

pub fn execute(
    &self,
    input: &[u8],
    output: &mut BytesRef<'_>
) -> Result<(), &'static str>
[src]

Simple forwarder for execute.

pub fn is_active(&self, at: u64) -> bool[src]

Whether the builtin is activated at the given block number.

Trait Implementations

impl TryFrom<Builtin> for Builtin[src]

type Error = VapcoreError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Builtin

impl Send for Builtin

impl Sync for Builtin

impl Unpin for Builtin

impl UnwindSafe for Builtin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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