Enum casper_types::Key [−][src]
The type under which data (e.g. CLValue
s, smart contracts, user accounts)
are indexed on the network.
Variants
Account(AccountHash)
A Key
under which a user account is stored.
Hash(HashAddr)
A Key
under which a smart contract is stored and which is the pseudo-hash of the
contract.
URef(URef)
A Key
which is a URef
, under which most types of data can be stored.
Transfer(TransferAddr)
A Key
under which we store a transfer.
DeployInfo(DeployHash)
A Key
under which we store a deploy info.
EraInfo(EraId)
A Key
under which we store an era info.
Implementations
impl Key
[src]
pub const fn max_serialized_length() -> usize
[src]
Returns the maximum size a Key
can be serialized into.
pub fn normalize(self) -> Key
[src]
If self
is of type Key::URef
, returns self
with the
AccessRights
stripped from the wrapped URef
, otherwise
returns self
unmodified.
pub fn to_formatted_string(&self) -> String
[src]
Returns a human-readable version of self
, with the inner bytes encoded to Base16.
pub fn from_formatted_str(input: &str) -> Result<Key, FromStrError>
[src]
Parses a string formatted as per Self::to_formatted_string()
into a Key
.
pub fn into_account(self) -> Option<AccountHash>
[src]
Returns the inner bytes of self
if self
is of type Key::Account
, otherwise returns
None
.
pub fn into_hash(self) -> Option<HashAddr>
[src]
Returns the inner bytes of self
if self
is of type Key::Hash
, otherwise returns
None
.
pub fn as_uref(&self) -> Option<&URef>
[src]
pub fn into_uref(self) -> Option<URef>
[src]
pub fn uref_to_hash(&self) -> Option<Key>
[src]
Trait Implementations
impl CLTyped for Key
[src]
impl Clone for Key
[src]
impl Copy for Key
[src]
impl Debug for Key
[src]
impl<'de> Deserialize<'de> for Key
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
impl Display for Key
[src]
impl Eq for Key
[src]
impl From<[u8; 32]> for Key
[src]
impl From<AccountHash> for Key
[src]
fn from(account_hash: AccountHash) -> Key
[src]
impl From<ContractHash> for Key
[src]
fn from(contract_hash: ContractHash) -> Key
[src]
impl From<ContractPackageHash> for Key
[src]
fn from(package_hash: ContractPackageHash) -> Key
[src]
impl From<ContractWasmHash> for Key
[src]
fn from(wasm_hash: ContractWasmHash) -> Key
[src]
impl From<TransferAddr> for Key
[src]
fn from(transfer_addr: TransferAddr) -> Key
[src]
impl From<URef> for Key
[src]
impl FromBytes for Key
[src]
fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>
[src]
fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>
[src]
impl Hash for Key
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Key
[src]
fn cmp(&self, other: &Key) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Key> for Key
[src]
impl PartialOrd<Key> for Key
[src]
fn partial_cmp(&self, other: &Key) -> Option<Ordering>
[src]
fn lt(&self, other: &Key) -> bool
[src]
fn le(&self, other: &Key) -> bool
[src]
fn gt(&self, other: &Key) -> bool
[src]
fn ge(&self, other: &Key) -> bool
[src]
impl Serialize for Key
[src]
impl StructuralEq for Key
[src]
impl StructuralPartialEq for Key
[src]
impl ToBytes for Key
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Error>
[src]
fn serialized_length(&self) -> usize
[src]
fn into_bytes(self) -> Result<Vec<u8>, Error> where
Self: Sized,
[src]
Self: Sized,
impl TryFrom<Key> for URef
[src]
Auto Trait Implementations
impl RefUnwindSafe for Key
[src]
impl Send for Key
[src]
impl Sync for Key
[src]
impl Unpin for Key
[src]
impl UnwindSafe for Key
[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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,