pub struct ModelId<M>where
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> Copy for ModelId<M>where
M: ?Sized,
impl<M> Eq for ModelId<M>where
M: ?Sized,
Source§impl<M> From<u64> for ModelId<M>where
M: ?Sized,
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> From<u64> for ModelId<M>where
M: ?Sized,
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> Ord for ModelId<M>where
M: ?Sized,
impl<M> Ord for ModelId<M>where
M: ?Sized,
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> PartialEq<u64> for ModelId<M>where
M: ?Sized,
Integer-keyed ids compare against their key value directly: assert_eq!(ids, [1, 3])
reads the way integer-keyed code always has.
impl<M> PartialEq<u64> for ModelId<M>where
M: ?Sized,
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> PartialOrd for ModelId<M>where
M: ?Sized,
impl<M> PartialOrd for ModelId<M>where
M: ?Sized,
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more