Struct casper_types::contracts::ContractPackage [−][src]
pub struct ContractPackage { /* fields omitted */ }
Expand description
Contract definition, metadata, and security container.
Implementations
impl ContractPackage
[src]
impl ContractPackage
[src]pub fn new(
access_key: URef,
versions: ContractVersions,
disabled_versions: DisabledVersions,
groups: Groups,
lock_status: ContractPackageStatus
) -> Self
[src]
pub fn new(
access_key: URef,
versions: ContractVersions,
disabled_versions: DisabledVersions,
groups: Groups,
lock_status: ContractPackageStatus
) -> Self
[src]Create new ContractPackage
(with no versions) from given access key.
pub fn access_key(&self) -> URef
[src]
pub fn access_key(&self) -> URef
[src]Get the access key for this contract.
pub fn groups_mut(&mut self) -> &mut Groups
[src]
pub fn groups_mut(&mut self) -> &mut Groups
[src]Get the mutable group definitions for this contract.
pub fn add_group(&mut self, group: Group, urefs: BTreeSet<URef>)
[src]
pub fn add_group(&mut self, group: Group, urefs: BTreeSet<URef>)
[src]Adds new group to this contract.
pub fn lookup_contract_hash(
&self,
contract_version_key: ContractVersionKey
) -> Option<&ContractHash>
[src]
pub fn lookup_contract_hash(
&self,
contract_version_key: ContractVersionKey
) -> Option<&ContractHash>
[src]Lookup the contract hash for a given contract version (if present)
pub fn is_version_enabled(
&self,
contract_version_key: ContractVersionKey
) -> bool
[src]
pub fn is_version_enabled(
&self,
contract_version_key: ContractVersionKey
) -> bool
[src]Checks if the given contract version exists and is available for use.
pub fn insert_contract_version(
&mut self,
protocol_version_major: ProtocolVersionMajor,
contract_hash: ContractHash
) -> ContractVersionKey
[src]
pub fn insert_contract_version(
&mut self,
protocol_version_major: ProtocolVersionMajor,
contract_hash: ContractHash
) -> ContractVersionKey
[src]Insert a new contract version; the next sequential version number will be issued.
pub fn disable_contract_version(
&mut self,
contract_hash: ContractHash
) -> Result<(), Error>
[src]
pub fn disable_contract_version(
&mut self,
contract_hash: ContractHash
) -> Result<(), Error>
[src]Disable the contract version corresponding to the given hash (if it exists).
pub fn versions(&self) -> &ContractVersions
[src]
pub fn versions(&self) -> &ContractVersions
[src]Returns reference to all of this contract’s versions.
pub fn enabled_versions(&self) -> ContractVersions
[src]
pub fn enabled_versions(&self) -> ContractVersions
[src]Returns all of this contract’s enabled contract versions.
pub fn versions_mut(&mut self) -> &mut ContractVersions
[src]
pub fn versions_mut(&mut self) -> &mut ContractVersions
[src]Returns mutable reference to all of this contract’s versions (enabled and disabled).
pub fn take_versions(self) -> ContractVersions
[src]
pub fn take_versions(self) -> ContractVersions
[src]Consumes the object and returns all of this contract’s versions (enabled and disabled).
pub fn disabled_versions(&self) -> &DisabledVersions
[src]
pub fn disabled_versions(&self) -> &DisabledVersions
[src]Returns all of this contract’s disabled versions.
pub fn disabled_versions_mut(&mut self) -> &mut DisabledVersions
[src]
pub fn disabled_versions_mut(&mut self) -> &mut DisabledVersions
[src]Returns mut reference to all of this contract’s disabled versions.
pub fn remove_group(&mut self, group: &Group) -> bool
[src]
pub fn remove_group(&mut self, group: &Group) -> bool
[src]Removes a group from this contract (if it exists).
pub fn current_contract_version(&self) -> Option<ContractVersionKey>
[src]
pub fn current_contract_version(&self) -> Option<ContractVersionKey>
[src]Return the contract version key for the newest enabled contract version.
pub fn current_contract_hash(&self) -> Option<ContractHash>
[src]
pub fn current_contract_hash(&self) -> Option<ContractHash>
[src]Return the contract hash for the newest enabled contract version.
pub fn get_lock_status(&self) -> ContractPackageStatus
[src]
pub fn get_lock_status(&self) -> ContractPackageStatus
[src]Return the package status itself
Trait Implementations
impl Clone for ContractPackage
[src]
impl Clone for ContractPackage
[src]fn clone(&self) -> ContractPackage
[src]
fn clone(&self) -> ContractPackage
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ContractPackage
[src]
impl Debug for ContractPackage
[src]impl Default for ContractPackage
[src]
impl Default for ContractPackage
[src]fn default() -> ContractPackage
[src]
fn default() -> ContractPackage
[src]Returns the “default value” for a type. Read more
impl FromBytes for ContractPackage
[src]
impl FromBytes for ContractPackage
[src]impl PartialEq<ContractPackage> for ContractPackage
[src]
impl PartialEq<ContractPackage> for ContractPackage
[src]fn eq(&self, other: &ContractPackage) -> bool
[src]
fn eq(&self, other: &ContractPackage) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ContractPackage) -> bool
[src]
fn ne(&self, other: &ContractPackage) -> bool
[src]This method tests for !=
.
impl Serialize for ContractPackage
[src]
impl Serialize for ContractPackage
[src]impl ToBytes for ContractPackage
[src]
impl ToBytes for ContractPackage
[src]fn serialized_length(&self) -> usize
[src]
fn serialized_length(&self) -> usize
[src]Returns the length of the Vec<u8>
which would be returned from a successful call to
to_bytes()
or into_bytes()
. The data is not actually serialized, so this call is
relatively cheap. Read more
impl Eq for ContractPackage
[src]
impl StructuralEq for ContractPackage
[src]
impl StructuralPartialEq for ContractPackage
[src]
Auto Trait Implementations
impl RefUnwindSafe for ContractPackage
impl Send for ContractPackage
impl Sync for ContractPackage
impl Unpin for ContractPackage
impl UnwindSafe for ContractPackage
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
R: 'a,
T: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
R: 'a,
T: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
R: 'a,
T: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
R: 'a,
T: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
R: 'a,
T: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
R: 'a,
T: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
R: 'a,
T: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
R: 'a,
T: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeDeref for T
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
impl<T> PipeRef for T
impl<T> PipeRef for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> Tap for T
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Calls tap
in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> TapDeref for T
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,