pub struct DataKey { /* private fields */ }Expand description
DataKey
Implementations§
Source§impl DataKey
impl DataKey
Sourcepub const STORED_SIZE_BYTES: u64
pub const STORED_SIZE_BYTES: u64
Fixed on-disk size in bytes (stable, protocol-level)
Sourcepub const STORED_SIZE_USIZE: usize
pub const STORED_SIZE_USIZE: usize
Fixed in-memory size (for buffers and arrays only)
Sourcepub fn try_new<E>(id: E::Id) -> Result<Self, InternalError>where
E: EntityKind,
pub fn try_new<E>(id: E::Id) -> Result<Self, InternalError>where
E: EntityKind,
Construct using compile-time entity metadata.
This requires that the entity ID is persistable.
Sourcepub fn try_id<E>(&self) -> Result<E::Id, InternalError>where
E: EntityKind,
pub fn try_id<E>(&self) -> Result<E::Id, InternalError>where
E: EntityKind,
Decode a semantic identity from this data key.
This is a fallible boundary that validates entity identity and key compatibility against the target entity type.
Sourcepub fn from_storage_key<E: EntityKind>(key: StorageKey) -> Self
pub fn from_storage_key<E: EntityKind>(key: StorageKey) -> Self
Construct a DataKey from a raw StorageKey using entity metadata.
pub fn lower_bound<E>() -> Selfwhere
E: EntityKind,
pub fn upper_bound<E>() -> Selfwhere
E: EntityKind,
pub const fn entity_name(&self) -> &EntityName
Sourcepub const fn entry_size_bytes(value_len: u64) -> u64
pub const fn entry_size_bytes(value_len: u64) -> u64
Compute on-disk entry size from value length.
pub fn max_storable() -> Self
Sourcepub fn to_raw(&self) -> Result<RawDataKey, InternalError>
pub fn to_raw(&self) -> Result<RawDataKey, InternalError>
Encode into fixed-size on-disk representation.
pub fn try_from_raw(raw: &RawDataKey) -> Result<Self, DataKeyDecodeError>
Trait Implementations§
Source§impl Ord for DataKey
impl Ord for DataKey
Source§impl PartialOrd for DataKey
impl PartialOrd for DataKey
impl Eq for DataKey
impl StructuralPartialEq for DataKey
Auto Trait Implementations§
impl Freeze for DataKey
impl RefUnwindSafe for DataKey
impl Send for DataKey
impl Sync for DataKey
impl Unpin for DataKey
impl UnsafeUnpin for DataKey
impl UnwindSafe for DataKey
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