pub enum CollectionType {
Document(DocumentMode),
Columnar(ColumnarProfile),
KeyValue(KvConfig),
}Expand description
The type of a collection, determining its storage engine and query behavior.
Three top-level modes:
Document: B-tree storage in redb (schemaless MessagePack or strict Binary Tuples).Columnar: Compressed segment files with profile specialization (plain, timeseries, spatial).KeyValue: Hash-indexed O(1) point lookups with typed value fields (Binary Tuples).
Variants§
Document(DocumentMode)
Document storage in redb B-tree. Schemaless (MessagePack) or strict (Binary Tuples).
Columnar(ColumnarProfile)
Columnar storage in compressed segment files. Profile determines constraints and specialized behavior.
KeyValue(KvConfig)
Key-Value storage with hash-indexed primary key. O(1) point lookups, optional TTL, optional secondary indexes. Value fields use Binary Tuple codec (same as strict mode) for O(1) field extraction.
Implementations§
Source§impl CollectionType
impl CollectionType
Sourcepub fn strict(schema: StrictSchema) -> Self
pub fn strict(schema: StrictSchema) -> Self
Strict document with schema.
Sourcepub fn timeseries(
time_key: impl Into<String>,
interval: impl Into<String>,
) -> Self
pub fn timeseries( time_key: impl Into<String>, interval: impl Into<String>, ) -> Self
Columnar with timeseries profile.
Sourcepub fn kv(schema: StrictSchema) -> Self
pub fn kv(schema: StrictSchema) -> Self
Key-Value collection with typed schema and optional TTL.
The schema MUST contain exactly one PRIMARY KEY column (the hash key). Remaining columns are value fields encoded as Binary Tuples.
Sourcepub fn kv_with_ttl(schema: StrictSchema, ttl: KvTtlPolicy) -> Self
pub fn kv_with_ttl(schema: StrictSchema, ttl: KvTtlPolicy) -> Self
Key-Value collection with TTL policy.
pub fn is_document(&self) -> bool
pub fn is_columnar(&self) -> bool
pub fn is_timeseries(&self) -> bool
pub fn is_strict(&self) -> bool
pub fn is_schemaless(&self) -> bool
pub fn is_kv(&self) -> bool
pub fn as_str(&self) -> &'static str
Sourcepub fn document_mode(&self) -> Option<&DocumentMode>
pub fn document_mode(&self) -> Option<&DocumentMode>
Get the document mode, if this is a document collection.
Sourcepub fn columnar_profile(&self) -> Option<&ColumnarProfile>
pub fn columnar_profile(&self) -> Option<&ColumnarProfile>
Get the columnar profile, if this is a columnar collection.
Trait Implementations§
Source§impl Clone for CollectionType
impl Clone for CollectionType
Source§fn clone(&self) -> CollectionType
fn clone(&self) -> CollectionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CollectionType
impl Debug for CollectionType
Source§impl Default for CollectionType
impl Default for CollectionType
Source§impl<'de> Deserialize<'de> for CollectionType
impl<'de> Deserialize<'de> for CollectionType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CollectionType
impl Display for CollectionType
Source§impl FromStr for CollectionType
impl FromStr for CollectionType
Source§impl PartialEq for CollectionType
impl PartialEq for CollectionType
Source§impl Serialize for CollectionType
impl Serialize for CollectionType
impl Eq for CollectionType
impl StructuralPartialEq for CollectionType
Auto Trait Implementations§
impl Freeze for CollectionType
impl RefUnwindSafe for CollectionType
impl Send for CollectionType
impl Sync for CollectionType
impl Unpin for CollectionType
impl UnsafeUnpin for CollectionType
impl UnwindSafe for CollectionType
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
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> 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.