pub struct Schema { /* private fields */ }Expand description
An immutable collection schema including the required ts: i64 column.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn timestamp_only() -> Self
pub fn timestamp_only() -> Self
Creates the mandatory timestamp-only schema used by public ingest today.
Sourcepub fn new(user_columns: Vec<ColumnDefinition>) -> Result<Self, SchemaError>
pub fn new(user_columns: Vec<ColumnDefinition>) -> Result<Self, SchemaError>
Validates user columns and prepends the reserved timestamp definition.
Sourcepub fn columns(&self) -> &[ColumnDefinition]
pub fn columns(&self) -> &[ColumnDefinition]
Returns all declarations, beginning with the required timestamp column.
Sourcepub fn column(&self, id: ColumnId) -> Option<&ColumnDefinition>
pub fn column(&self, id: ColumnId) -> Option<&ColumnDefinition>
Finds a declaration by its typed identifier.
Sourcepub fn user_column_count(&self) -> usize
pub fn user_column_count(&self) -> usize
Returns the number of user-declared columns, excluding ts.
Trait Implementations§
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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
Mutably borrows from an owned value. Read more