pub struct EntityKey(/* private fields */);Expand description
An opaque canonical entity key.
Implementations§
Source§impl EntityKey
impl EntityKey
Sourcepub fn new(bytes: Vec<u8>) -> Result<Self, KeyBytesError>
pub fn new(bytes: Vec<u8>) -> Result<Self, KeyBytesError>
Validates a key’s purpose/version envelope and hard size bounds.
Component-level validation requires the exact compiler-produced schema.
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self, KeyBytesError>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, KeyBytesError>
Validates a key’s purpose/version envelope and hard size bounds.
Sourcepub fn entity_type_id(&self) -> EntityTypeId
pub fn entity_type_id(&self) -> EntityTypeId
Returns the stable type identity encoded in the key envelope.
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Returns the canonical key bytes.
Trait Implementations§
impl Eq for EntityKey
Source§impl Ord for EntityKey
impl Ord for EntityKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for EntityKey
impl PartialOrd for EntityKey
impl StructuralPartialEq for EntityKey
Auto Trait Implementations§
impl Freeze for EntityKey
impl RefUnwindSafe for EntityKey
impl Send for EntityKey
impl Sync for EntityKey
impl Unpin for EntityKey
impl UnsafeUnpin for EntityKey
impl UnwindSafe for EntityKey
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