pub struct DataKey { /* private fields */ }Expand description
DataKey
Implementations§
Source§impl DataKey
impl DataKey
pub const STORED_SIZE: u32
Sourcepub fn new<E: EntityKind>(key: impl Into<Key>) -> Self
pub fn new<E: EntityKind>(key: impl Into<Key>) -> Self
Build a data key for the given entity type and primary key.
pub const fn lower_bound<E: EntityKind>() -> Self
pub const fn upper_bound<E: EntityKind>() -> Self
Sourcepub const fn entity_name(&self) -> &EntityName
pub const fn entity_name(&self) -> &EntityName
Entity name (stable, compile-time constant per entity type).
Sourcepub const fn entry_size_bytes(value_len: u64) -> u64
pub const fn entry_size_bytes(value_len: u64) -> u64
Compute the on-disk size used by a single data entry from its value length.
Includes the bounded DataKey size and the value bytes.
Sourcepub fn max_storable() -> Self
pub fn max_storable() -> Self
Max sentinel key for sizing.
pub fn to_raw(&self) -> RawDataKey
pub fn try_from_raw(raw: &RawDataKey) -> Result<Self, &'static str>
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