pub struct InstanceId {
pub map_id: u64,
pub ns: Option<u64>,
}Expand description
The complete public identity of a collection instance — the same
shape at every layer: in-memory comparison, the persisted meta bytes,
and this token. ns: None ⇔ default namespace ⇔ the 16-byte meta
form; a bare u64 converts losslessly (From<u64> ⇒ ns: None).
Display/FromStr round-trip as "42" (default ns) or "42@7"
(ns 7) — config/log friendly.
Canonical form: the default namespace is spelled ns: None,
never Some(DEFAULT_NS_ID). Every constructor under this type’s
control (From<u64>, FromStr, Deserialize, and the handles’
instance_id()) canonicalizes, so Eq/Hash are reliable for
tokens obtained through the API. Routing treats both spellings as
the default namespace regardless.
Fields§
§map_id: u64The storage prefix — what pre-v16 releases called instance_id.
ns: Option<u64>The owning namespace; None = default namespace (canonical —
see the type docs).
Implementations§
Source§impl InstanceId
impl InstanceId
Sourcepub fn new(map_id: u64, ns: u64) -> InstanceId
pub fn new(map_id: u64, ns: u64) -> InstanceId
Canonical constructor: DEFAULT_NS_ID folds to ns: None.
The single construction point handles use — keeps canonical-form
logic out of every call site.
Trait Implementations§
Source§impl Clone for InstanceId
impl Clone for InstanceId
Source§fn clone(&self) -> InstanceId
fn clone(&self) -> InstanceId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InstanceId
Source§impl Debug for InstanceId
impl Debug for InstanceId
Source§impl<'de> Deserialize<'de> for InstanceId
impl<'de> Deserialize<'de> for InstanceId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InstanceId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InstanceId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for InstanceId
impl Display for InstanceId
impl Eq for InstanceId
Source§impl From<InstanceIdWire> for InstanceId
impl From<InstanceIdWire> for InstanceId
Source§fn from(w: InstanceIdWire) -> InstanceId
fn from(w: InstanceIdWire) -> InstanceId
Source§impl From<u64> for InstanceId
impl From<u64> for InstanceId
Source§fn from(map_id: u64) -> InstanceId
fn from(map_id: u64) -> InstanceId
Source§impl FromStr for InstanceId
impl FromStr for InstanceId
Source§impl Hash for InstanceId
impl Hash for InstanceId
Source§impl Ord for InstanceId
impl Ord for InstanceId
Source§fn cmp(&self, other: &InstanceId) -> Ordering
fn cmp(&self, other: &InstanceId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for InstanceId
impl PartialEq for InstanceId
Source§impl PartialOrd for InstanceId
impl PartialOrd for InstanceId
Source§impl Serialize for InstanceId
impl Serialize for InstanceId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for InstanceId
Auto Trait Implementations§
impl Freeze for InstanceId
impl RefUnwindSafe for InstanceId
impl Send for InstanceId
impl Sync for InstanceId
impl Unpin for InstanceId
impl UnsafeUnpin for InstanceId
impl UnwindSafe for InstanceId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> KeyDe for Twhere
T: DeserializeOwned,
impl<T> KeyDe for Twhere
T: DeserializeOwned,
Source§impl<T> KeyEn for Twhere
T: Serialize,
impl<T> KeyEn for Twhere
T: Serialize,
Source§fn try_encode_key(&self) -> Result<Vec<u8>, VsdbError>
fn try_encode_key(&self) -> Result<Vec<u8>, VsdbError>
Err only if the
Serialize implementation is broken — see module-level trust
model for details.