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 new<E: EntityKind>(key: impl Into<Key>) -> Self
pub fn new<E: EntityKind>(key: impl Into<Key>) -> Self
Construct using compile-time entity metadata.
This cannot fail in practice: ENTITY_NAME is generated and validated
at compile time. If it is ever invalid, that is a programmer error.
pub fn lower_bound<E: EntityKind>() -> Self
pub fn upper_bound<E: EntityKind>() -> Self
pub const fn key(&self) -> Key
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 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