pub struct StrictSchema {
pub columns: Vec<ColumnDef>,
pub version: u32,
pub dropped_columns: Vec<DroppedColumn>,
pub bitemporal: bool,
}Expand description
Schema for a strict document collection (Binary Tuple serialization).
Fields§
§columns: Vec<ColumnDef>§version: u32§dropped_columns: Vec<DroppedColumn>Columns that were removed via ALTER DROP COLUMN. Retained so the
reader can reconstruct the physical layout of tuples written before
the drop.
bitemporal: boolWhen true, the tuple reserves fixed-Int64 slots 0/1/2 for
__system_from_ms, __valid_from_ms, __valid_until_ms. These
columns are prepended by StrictSchema::new_bitemporal and appear
in columns like any other field; the flag preserves the intent
across catalog round-trips.
Implementations§
Source§impl StrictSchema
impl StrictSchema
pub fn new(columns: Vec<ColumnDef>) -> Result<Self, SchemaError>
Sourcepub fn new_bitemporal(user_columns: Vec<ColumnDef>) -> Result<Self, SchemaError>
pub fn new_bitemporal(user_columns: Vec<ColumnDef>) -> Result<Self, SchemaError>
Build a schema for a bitemporal strict collection. Prepends three
reserved Int64 columns (__system_from_ms, __valid_from_ms,
__valid_until_ms) at positions 0/1/2 so the tuple decoder can
extract them via fixed-offset jump. User columns are rejected if
any collides with a reserved name.
Sourcepub fn variable_column_count(&self) -> usize
pub fn variable_column_count(&self) -> usize
Count of variable-length columns (determines offset table size).
Sourcepub fn fixed_fields_size(&self) -> usize
pub fn fixed_fields_size(&self) -> usize
Total fixed-field byte size (for Binary Tuple layout computation).
Sourcepub fn null_bitmap_size(&self) -> usize
pub fn null_bitmap_size(&self) -> usize
Null bitmap size in bytes.
Sourcepub fn schema_for_version(&self, version: u32) -> StrictSchema
pub fn schema_for_version(&self, version: u32) -> StrictSchema
Build a sub-schema matching the physical layout of tuples written at
the given version. Columns added after version are excluded;
columns dropped after version are re-inserted at their original
positions.
Sourcepub fn parse_default_literal(expr: &str) -> Value
pub fn parse_default_literal(expr: &str) -> Value
Parse a SQL default literal (e.g. 'n/a', 0, true) into a Value.
Covers the common cases produced by ALTER ADD COLUMN ... DEFAULT ....
Returns Value::Null for expressions that cannot be trivially evaluated
at read time (functions, sub-queries, etc.).
Trait Implementations§
Source§impl Clone for StrictSchema
impl Clone for StrictSchema
Source§fn clone(&self) -> StrictSchema
fn clone(&self) -> StrictSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StrictSchema
impl Debug for StrictSchema
Source§impl<'de> Deserialize<'de> for StrictSchema
impl<'de> Deserialize<'de> for StrictSchema
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<'__msgpack_de> FromMessagePack<'__msgpack_de> for StrictSchema
impl<'__msgpack_de> FromMessagePack<'__msgpack_de> for StrictSchema
Source§impl PartialEq for StrictSchema
impl PartialEq for StrictSchema
Source§fn eq(&self, other: &StrictSchema) -> bool
fn eq(&self, other: &StrictSchema) -> bool
self and other values to be equal, and is used by ==.Source§impl SchemaOps for StrictSchema
impl SchemaOps for StrictSchema
Source§impl Serialize for StrictSchema
impl Serialize for StrictSchema
Source§impl ToMessagePack for StrictSchema
impl ToMessagePack for StrictSchema
impl Eq for StrictSchema
impl StructuralPartialEq for StrictSchema
Auto Trait Implementations§
impl Freeze for StrictSchema
impl RefUnwindSafe for StrictSchema
impl Send for StrictSchema
impl Sync for StrictSchema
impl Unpin for StrictSchema
impl UnsafeUnpin for StrictSchema
impl UnwindSafe for StrictSchema
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> 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.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.