Struct casper_types::contracts::ContractVersionKey
source · pub struct ContractVersionKey(/* private fields */);
Expand description
Major element of ProtocolVersion
combined with ContractVersion
.
Implementations§
source§impl ContractVersionKey
impl ContractVersionKey
sourcepub fn new(
protocol_version_major: ProtocolVersionMajor,
contract_version: ContractVersion
) -> Self
pub fn new( protocol_version_major: ProtocolVersionMajor, contract_version: ContractVersion ) -> Self
Returns a new instance of ContractVersionKey with provided values.
sourcepub fn protocol_version_major(self) -> ProtocolVersionMajor
pub fn protocol_version_major(self) -> ProtocolVersionMajor
Returns the major element of the protocol version this contract is compatible with.
sourcepub fn contract_version(self) -> ContractVersion
pub fn contract_version(self) -> ContractVersion
Returns the contract version within the protocol major version.
Trait Implementations§
source§impl Clone for ContractVersionKey
impl Clone for ContractVersionKey
source§fn clone(&self) -> ContractVersionKey
fn clone(&self) -> ContractVersionKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ContractVersionKey
impl Debug for ContractVersionKey
source§impl Display for ContractVersionKey
impl Display for ContractVersionKey
source§impl From<ContractVersionKey> for (ProtocolVersionMajor, ContractVersion)
impl From<ContractVersionKey> for (ProtocolVersionMajor, ContractVersion)
source§fn from(contract_version_key: ContractVersionKey) -> Self
fn from(contract_version_key: ContractVersionKey) -> Self
Converts to this type from the input type.
source§impl FromBytes for ContractVersionKey
impl FromBytes for ContractVersionKey
source§impl Ord for ContractVersionKey
impl Ord for ContractVersionKey
source§fn cmp(&self, other: &ContractVersionKey) -> Ordering
fn cmp(&self, other: &ContractVersionKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ContractVersionKey
impl PartialEq for ContractVersionKey
source§fn eq(&self, other: &ContractVersionKey) -> bool
fn eq(&self, other: &ContractVersionKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ContractVersionKey
impl PartialOrd for ContractVersionKey
source§fn partial_cmp(&self, other: &ContractVersionKey) -> Option<Ordering>
fn partial_cmp(&self, other: &ContractVersionKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl Serialize for ContractVersionKey
impl Serialize for ContractVersionKey
source§impl ToBytes for ContractVersionKey
impl ToBytes for ContractVersionKey
source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
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.impl Copy for ContractVersionKey
impl Eq for ContractVersionKey
impl StructuralEq for ContractVersionKey
impl StructuralPartialEq for ContractVersionKey
Auto Trait Implementations§
impl RefUnwindSafe for ContractVersionKey
impl Send for ContractVersionKey
impl Sync for ContractVersionKey
impl Unpin for ContractVersionKey
impl UnwindSafe for ContractVersionKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more