pub struct Schema { /* private fields */ }Expand description
The fixed schema shared by every block in an Acta file.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn new(
schema_id: u64,
columns: Vec<Column>,
primary_column_id: Option<u32>,
) -> Self
pub fn new( schema_id: u64, columns: Vec<Column>, primary_column_id: Option<u32>, ) -> Self
Construct immutable schema metadata.
Schema validation that depends on the file format is performed by
crate::Writer::create.
Sourcepub fn columns(&self) -> &[Column]
pub fn columns(&self) -> &[Column]
The columns in schema order, which is the order the file declares them and the order a reader reports them.
Section 7 does not require that order to be sorted by column ID. Only a data frame’s column table is sorted, and the writer sorts it there.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
The number of declared columns.
Sourcepub fn primary_column(&self) -> Option<&Column>
pub fn primary_column(&self) -> Option<&Column>
The selected primary timestamp/date column, if the schema has one.
Sourcepub fn primary_column_id(&self) -> Option<u32>
pub fn primary_column_id(&self) -> Option<u32>
The selected primary timestamp/date column ID, if present.
Sourcepub fn column_by_id(&self, id: u32) -> Option<&Column>
pub fn column_by_id(&self, id: u32) -> Option<&Column>
Find a column by its stable ID.
Sourcepub fn column_by_name(&self, name: &str) -> Option<&Column>
pub fn column_by_name(&self, name: &str) -> Option<&Column>
Find a column by its exact UTF-8 name.
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