Struct casper_types::contracts::Contract[][src]

pub struct Contract { /* fields omitted */ }

Methods and type signatures supported by a contract.

Implementations

impl Contract[src]

pub fn new(
    contract_package_hash: ContractPackageHash,
    contract_wasm_hash: ContractWasmHash,
    named_keys: NamedKeys,
    entry_points: EntryPoints,
    protocol_version: ProtocolVersion
) -> Self
[src]

Contract constructor.

pub fn contract_package_hash(&self) -> ContractPackageHash[src]

Hash for accessing contract package

pub fn contract_wasm_hash(&self) -> ContractWasmHash[src]

Hash for accessing contract WASM

pub fn has_entry_point(&self, name: &str) -> bool[src]

Checks whether there is a method with the given name

pub fn entry_point(&self, method: &str) -> Option<&EntryPoint>[src]

Returns the type signature for the given method.

pub fn protocol_version(&self) -> ProtocolVersion[src]

Get the protocol version this header is targeting.

pub fn add_entry_point<T: Into<String>>(&mut self, entry_point: EntryPoint)[src]

Adds new entry point

pub fn contract_wasm_key(&self) -> Key[src]

Hash for accessing contract bytes

pub fn entry_points(&self) -> &EntryPoints[src]

Returns immutable reference to methods

pub fn take_named_keys(self) -> NamedKeys[src]

Takes named_keys

pub fn named_keys(&self) -> &NamedKeys[src]

Returns a reference to named_keys

pub fn named_keys_append(&mut self, keys: &mut NamedKeys)[src]

Appends keys to named_keys

pub fn remove_named_key(&mut self, key: &str) -> Option<Key>[src]

Removes given named key.

pub fn set_protocol_version(&mut self, protocol_version: ProtocolVersion)[src]

Set protocol_version.

pub fn is_compatible_protocol_version(
    &self,
    protocol_version: ProtocolVersion
) -> bool
[src]

Determines if Contract is compatibile with a given ProtocolVersion.

Trait Implementations

impl Clone for Contract[src]

impl Debug for Contract[src]

impl Default for Contract[src]

impl Eq for Contract[src]

impl FromBytes for Contract[src]

impl PartialEq<Contract> for Contract[src]

impl Serialize for Contract[src]

impl StructuralEq for Contract[src]

impl StructuralPartialEq for Contract[src]

impl ToBytes for Contract[src]

Auto Trait Implementations

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> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

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>,