pub enum Key {
Account(Account),
Int(i64),
Principal(Principal),
Subaccount(Subaccount),
Timestamp(Timestamp),
Uint(u64),
Ulid(Ulid),
Unit,
}Expand description
Key
Treating IndexKey as the atomic, normalized unit of the keyspace Backing primary keys and secondary indexes with the same value representation Planning to enforce Copy semantics (i.e., fast, clean, safe)
Variants§
Account(Account)
Int(i64)
Principal(Principal)
Subaccount(Subaccount)
Timestamp(Timestamp)
Uint(u64)
Ulid(Ulid)
Unit
Implementations§
Source§impl Key
impl Key
pub const STORABLE_MAX_SIZE: u32 = 128u32
Sourcepub fn max_storable() -> Self
pub fn max_storable() -> Self
Sentinel key representing the maximum storable account value.
pub const fn lower_bound() -> Self
pub const fn upper_bound() -> Self
Trait Implementations§
Source§impl CandidType for Key
impl CandidType for Key
Source§impl<'de> Deserialize<'de> for Key
impl<'de> Deserialize<'de> for Key
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Principal> for Key
impl From<Principal> for Key
Source§fn from(v: WrappedPrincipal) -> Self
fn from(v: WrappedPrincipal) -> Self
Converts to this type from the input type.
Source§impl From<Subaccount> for Key
impl From<Subaccount> for Key
Source§fn from(v: Subaccount) -> Self
fn from(v: Subaccount) -> Self
Converts to this type from the input type.
Source§impl Ord for Key
impl Ord for Key
Source§impl PartialEq<Key> for Subaccount
impl PartialEq<Key> for Subaccount
Source§impl PartialEq<Subaccount> for Key
impl PartialEq<Subaccount> for Key
Source§impl PartialOrd for Key
impl PartialOrd for Key
Source§impl Storable for Key
impl Storable for Key
Source§fn to_bytes(&self) -> Cow<'_, [u8]>
fn to_bytes(&self) -> Cow<'_, [u8]>
Converts the element into a possibly borrowed byte slice. Read more
Source§fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
fn from_bytes(bytes: Cow<'_, [u8]>) -> Self
Converts bytes into an element.
Source§fn to_bytes_checked(&self) -> Cow<'_, [u8]>
fn to_bytes_checked(&self) -> Cow<'_, [u8]>
Like
to_bytes, but checks that bytes conform to declared bounds.Source§fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
fn into_bytes_checked(self) -> Vec<u8> ⓘwhere
Self: Sized,
Like
into_bytes, but checks that bytes conform to declared bounds.Source§fn check_bounds(bytes: &[u8])
fn check_bounds(bytes: &[u8])
Validates that a byte slice fits within this type’s declared bounds.
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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