pub struct Id<K: IdKind>(u32, PhantomData<K>);Expand description
One entity’s identity: a per-kind, document-global counter.
The wire form is the Display spelling — b7 —
which is both what a human carries in their head and a legal JSON map
key, so the entity tables can be objects keyed by id.
Tuple Fields§
§0: u32§1: PhantomData<K>Implementations§
Trait Implementations§
Source§impl<K: IdKind> Debug for Id<K>
The kind is a compile-time tag, so the derive would print it as
PhantomData<…> in every ?id the editor’s mutation log carries.
impl<K: IdKind> Debug for Id<K>
The kind is a compile-time tag, so the derive would print it as
PhantomData<…> in every ?id the editor’s mutation log carries.
Source§impl<K: IdKind> Default for Id<K>
NULL, never a minted id: the default is the meaningful zero (the
document root / “none”), and minting stays an explicit client act.
impl<K: IdKind> Default for Id<K>
NULL, never a minted id: the default is the meaningful zero (the
document root / “none”), and minting stays an explicit client act.
Source§impl<'de, K: IdKind> Deserialize<'de> for Id<K>
impl<'de, K: IdKind> Deserialize<'de> for Id<K>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: Ord + IdKind> Ord for Id<K>
impl<K: Ord + IdKind> Ord for Id<K>
Source§impl<K: PartialOrd + IdKind> PartialOrd for Id<K>
impl<K: PartialOrd + IdKind> PartialOrd for Id<K>
impl<K: Copy + IdKind> Copy for Id<K>
impl<K: Eq + IdKind> Eq for Id<K>
impl<K: IdKind> StructuralPartialEq for Id<K>
Auto Trait Implementations§
impl<K> Freeze for Id<K>
impl<K> RefUnwindSafe for Id<K>where
K: RefUnwindSafe,
impl<K> Send for Id<K>where
K: Send,
impl<K> Sync for Id<K>where
K: Sync,
impl<K> Unpin for Id<K>where
K: Unpin,
impl<K> UnsafeUnpin for Id<K>
impl<K> UnwindSafe for Id<K>where
K: UnwindSafe,
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