pub struct CollectionKey<'a> { /* private fields */ }Expand description
The canonical (database_id, bare_name) identity of a collection.
Borrowed: it never allocates. Build it with Self::from_bare from a
catalog name, or with Self::from_qualified /
Self::from_qualified_str from a database-qualified name.
No From<&str> impl exists, so a raw string never converts implicitly:
use nodedb_types::CollectionKey;
let key: CollectionKey<'_> = "1024/users".into();Implementations§
Source§impl<'a> CollectionKey<'a>
impl<'a> CollectionKey<'a>
Sourcepub fn from_bare(database_id: DatabaseId, name: &'a str) -> Self
pub fn from_bare(database_id: DatabaseId, name: &'a str) -> Self
Build a key from the bare name the catalog keys the collection by.
name must be the catalog name, never a "{database_id}/{name}"
string. A qualified name goes through Self::from_qualified.
Sourcepub fn from_qualified(
database_id: DatabaseId,
qualified: &'a QualifiedCollection,
) -> Result<Self, CollectionKeyError>
pub fn from_qualified( database_id: DatabaseId, qualified: &'a QualifiedCollection, ) -> Result<Self, CollectionKeyError>
Build a key from a QualifiedCollection, stripping its qualifier.
Sourcepub fn from_qualified_str(
database_id: DatabaseId,
qualified: &'a str,
) -> Result<Self, CollectionKeyError>
pub fn from_qualified_str( database_id: DatabaseId, qualified: &'a str, ) -> Result<Self, CollectionKeyError>
Build a key from a database-qualified name carried as a string on a plan, a WAL record, or the wire.
The default database stores names unqualified, so the name is taken
as-is. The empty name marks a plan with no routing collection and is
the same in both forms, so it is also taken as-is. Any other name in
any other database requires the exact "{database_id}/" prefix
QualifiedCollection::new writes. Exactly one prefix is stripped,
so a bare name that itself contains / survives intact.
Sourcepub fn database_id(&self) -> DatabaseId
pub fn database_id(&self) -> DatabaseId
The database the collection lives in.
Sourcepub fn qualified(&self) -> QualifiedCollection
pub fn qualified(&self) -> QualifiedCollection
The database-qualified name storage engines key data by.
Trait Implementations§
Source§impl<'a> Clone for CollectionKey<'a>
impl<'a> Clone for CollectionKey<'a>
impl<'a> Copy for CollectionKey<'a>
Source§impl<'a> Debug for CollectionKey<'a>
impl<'a> Debug for CollectionKey<'a>
impl<'a> Eq for CollectionKey<'a>
Source§impl<'a> Hash for CollectionKey<'a>
impl<'a> Hash for CollectionKey<'a>
Source§impl<'a> PartialEq for CollectionKey<'a>
impl<'a> PartialEq for CollectionKey<'a>
impl<'a> StructuralPartialEq for CollectionKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for CollectionKey<'a>
impl<'a> RefUnwindSafe for CollectionKey<'a>
impl<'a> Send for CollectionKey<'a>
impl<'a> Sync for CollectionKey<'a>
impl<'a> Unpin for CollectionKey<'a>
impl<'a> UnsafeUnpin for CollectionKey<'a>
impl<'a> UnwindSafe for CollectionKey<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.