pub struct ModelId<M: ?Sized> { /* private fields */ }Expand description
A typed, opaque id for one M row: Copy, 8 bytes, cheap to pass and compare. It wraps
the key’s path handle: Store::elem, query results, list slots and destinations all
speak it, and a wrong-model id is a compile error rather than a wrong row. ModelId::key
recovers the real key for display, deep links, or the persistence edge.
Ordering compares handles: meaningful for integer keys, arbitrary (but stable) for wide ones; it exists so ids can live in sorted containers.
Implementations§
Trait Implementations§
impl<M: ?Sized> Copy for ModelId<M>
impl<M: ?Sized> Eq for ModelId<M>
Source§impl<M: ?Sized> From<u64> for ModelId<M>
Raw path handles convert directly; this is how store.elem(k) keeps taking the values
Store::keys returns, and how integer keys stay literal-friendly.
impl<M: ?Sized> From<u64> for ModelId<M>
Raw path handles convert directly; this is how store.elem(k) keeps taking the values
Store::keys returns, and how integer keys stay literal-friendly.
Source§impl<M: ?Sized> Ord for ModelId<M>
impl<M: ?Sized> Ord for ModelId<M>
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
Source§impl<M: ?Sized> PartialEq<u64> for ModelId<M>
Integer-keyed ids compare against their key value directly: assert_eq!(ids, [1, 3])
reads the way integer-keyed code always has.
impl<M: ?Sized> PartialEq<u64> for ModelId<M>
Integer-keyed ids compare against their key value directly: assert_eq!(ids, [1, 3])
reads the way integer-keyed code always has.
Source§impl<M: ?Sized> PartialOrd for ModelId<M>
impl<M: ?Sized> PartialOrd for ModelId<M>
Auto Trait Implementations§
impl<M> Freeze for ModelId<M>where
M: ?Sized,
impl<M> RefUnwindSafe for ModelId<M>where
M: ?Sized,
impl<M> Send for ModelId<M>where
M: ?Sized,
impl<M> Sync for ModelId<M>where
M: ?Sized,
impl<M> Unpin for ModelId<M>where
M: ?Sized,
impl<M> UnsafeUnpin for ModelId<M>where
M: ?Sized,
impl<M> UnwindSafe for ModelId<M>where
M: ?Sized,
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