[−][src]Struct casper_types::contracts::Contract
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_package_hash: ContractPackageHash,
contract_wasm_hash: ContractWasmHash,
named_keys: NamedKeys,
entry_points: EntryPoints,
protocol_version: ProtocolVersion
) -> Self
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 is_compatible_protocol_version(
&self,
protocol_version: ProtocolVersion
) -> bool
[src]
&self,
protocol_version: ProtocolVersion
) -> bool
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]
pub fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>
[src]
pub fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>
[src]
impl PartialEq<Contract> for Contract
[src]
impl StructuralEq for Contract
[src]
impl StructuralPartialEq for Contract
[src]
impl ToBytes for Contract
[src]
Auto Trait Implementations
impl RefUnwindSafe for Contract
[src]
impl Send for Contract
[src]
impl Sync for Contract
[src]
impl Unpin for Contract
[src]
impl UnwindSafe for Contract
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,