pub struct CollectionContract {Show 21 fields
pub name: String,
pub declared_model: CollectionModel,
pub schema_mode: SchemaMode,
pub origin: ContractOrigin,
pub version: u32,
pub created_at_unix_ms: u128,
pub updated_at_unix_ms: u128,
pub default_ttl_ms: Option<u64>,
pub vector_dimension: Option<usize>,
pub vector_metric: Option<DistanceMetric>,
pub context_index_fields: Vec<String>,
pub declared_columns: Vec<DeclaredColumnContract>,
pub table_def: Option<TableDef>,
pub timestamps_enabled: bool,
pub context_index_enabled: bool,
pub metrics_raw_retention_ms: Option<u64>,
pub metrics_rollup_policies: Vec<String>,
pub metrics_tenant_identity: Option<String>,
pub metrics_namespace: Option<String>,
pub append_only: bool,
pub subscriptions: Vec<SubscriptionDescriptor>,
}Fields§
§name: String§declared_model: CollectionModel§schema_mode: SchemaMode§origin: ContractOrigin§version: u32§created_at_unix_ms: u128§updated_at_unix_ms: u128§default_ttl_ms: Option<u64>§vector_dimension: Option<usize>§vector_metric: Option<DistanceMetric>§context_index_fields: Vec<String>§declared_columns: Vec<DeclaredColumnContract>§table_def: Option<TableDef>§timestamps_enabled: boolEnabled by CREATE TABLE ... WITH timestamps = true. When true,
the runtime auto-populates two user-visible columns
created_at + updated_at (BIGINT unix-ms) sourced from the
UnifiedEntity::created_at/updated_at fields. created_at is
immutable after insert; updated_at is bumped on every mutation.
context_index_enabled: boolEnabled by CREATE TABLE ... WITH context_index = true (or by
naming specific context_index_fields). When true, every INSERT
tokenises the row’s text fields and populates the global context
index that backs SEARCH CONTEXT / SEARCH SIMILAR TEXT / ASK
(RAG). When false (default), inserts skip the tokenisation +
3-way RwLock write storm entirely — ~800 ns faster per insert,
and SEARCH returns empty for this collection.
Opt-in by design: pure OLTP tables (accounts, orders, events) pay zero indexing tax; search-oriented tables (articles, docs) flip the switch at CREATE time.
metrics_raw_retention_ms: Option<u64>Metrics collections are backed by time-series storage but carry a metrics-specific raw sample retention contract.
metrics_rollup_policies: Vec<String>Metrics rollup tiers declared by CREATE METRICS ... DOWNSAMPLE.
metrics_tenant_identity: Option<String>Metrics tenant identity source. Defaults to current tenant context and can be declared as a stable identity path for future ingestion slices.
metrics_namespace: Option<String>Metrics namespace identity. v0 starts with a default namespace so series identity is namespace-aware before Prometheus ingestion exists.
append_only: boolEnabled by CREATE TABLE ... APPEND ONLY or WITH (append_only = true). When true, the runtime rejects
UPDATE and DELETE against this collection at parse time
with a clear error — the operator’s immutability intent
becomes a first-class catalog fact rather than an RLS-shaped
approximation. Default false so legacy DDL keeps its
mutable semantics.
subscriptions: Vec<SubscriptionDescriptor>Declarative subscriptions created by WITH EVENTS. This is
metadata only in #291; event emission is wired by the outbox slice.
Trait Implementations§
Source§impl Clone for CollectionContract
impl Clone for CollectionContract
Source§fn clone(&self) -> CollectionContract
fn clone(&self) -> CollectionContract
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CollectionContract
impl RefUnwindSafe for CollectionContract
impl Send for CollectionContract
impl Sync for CollectionContract
impl Unpin for CollectionContract
impl UnsafeUnpin for CollectionContract
impl UnwindSafe for CollectionContract
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<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> 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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request