pub struct CatalogTableSpec {
pub name: Symbol,
pub policy: CatalogWritePolicy,
pub owner: Option<Symbol>,
pub required_fields: Vec<Symbol>,
pub unique_fields: Vec<Vec<Symbol>>,
}Expand description
Specification of one catalog table: its name, write policy, owner, and field constraints.
§Examples
let spec = CatalogTableSpec::new(Symbol::new("registry/libs"), CatalogWritePolicy::Mutable)
.with_required_fields(vec![Symbol::new("manifest")]);
assert_eq!(spec.policy, CatalogWritePolicy::Mutable);
assert_eq!(spec.required_fields, vec![Symbol::new("manifest")]);Fields§
§name: SymbolOpen symbol naming the table.
policy: CatalogWritePolicyWrite policy enforced on the table’s rows.
owner: Option<Symbol>Optional owning library symbol.
required_fields: Vec<Symbol>Fields every row of the table must carry.
unique_fields: Vec<Vec<Symbol>>Field tuples that must be unique across the table’s rows.
Implementations§
Source§impl CatalogTableSpec
impl CatalogTableSpec
Sourcepub fn new(name: Symbol, policy: CatalogWritePolicy) -> Self
pub fn new(name: Symbol, policy: CatalogWritePolicy) -> Self
Creates a spec with the given name and policy and no further constraints.
Sourcepub fn with_required_fields(self, fields: Vec<Symbol>) -> Self
pub fn with_required_fields(self, fields: Vec<Symbol>) -> Self
Returns the spec with its required fields replaced.
Trait Implementations§
Source§impl Clone for CatalogTableSpec
impl Clone for CatalogTableSpec
Source§fn clone(&self) -> CatalogTableSpec
fn clone(&self) -> CatalogTableSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CatalogTableSpec
impl Debug for CatalogTableSpec
impl Eq for CatalogTableSpec
Source§impl PartialEq for CatalogTableSpec
impl PartialEq for CatalogTableSpec
Source§fn eq(&self, other: &CatalogTableSpec) -> bool
fn eq(&self, other: &CatalogTableSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CatalogTableSpec
Auto Trait Implementations§
impl Freeze for CatalogTableSpec
impl RefUnwindSafe for CatalogTableSpec
impl Send for CatalogTableSpec
impl Sync for CatalogTableSpec
impl Unpin for CatalogTableSpec
impl UnsafeUnpin for CatalogTableSpec
impl UnwindSafe for CatalogTableSpec
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