Trait mem_query::header::Header[][src]

pub trait Header: Sized + Clone + List + 'static + for<'a> AsListRefs<'a> {
    fn col_opt<C: Col>(&self) -> Option<&C>;
fn has_col<C: Col>() -> bool;
fn is_disjoint<H: Header>() -> bool;
fn clone_from_rec_unchecked(_: &impl Record) -> Self; fn col_ref<C: Col>(&self) -> &C
    where
        Self: HasCol<C>
, { ... }
fn clone_from_rec<R>(rec: &R) -> Self
    where
        HCons<SubsetP, HCons<Quote<Self>, HCons<Quote<R::Cols>, HNil>>>: Pass,
        R: Record
, { ... } }
Expand description

Marker trait for HLists that can be record/relation headers

In addition to specifying the column data in the abstract, it is also used as the baseline Record implementation.

It must be a proper list of Col types that contains no duplicates. Because it is dependent on tylisp::List, a sealed trait, it cannot be implemented by downstream developers.

It was marked unsafe to implement because col_opt() must agree with HasCol. (Note: replaced by panicking unreachable call)

Required methods

fn col_opt<C: Col>(&self) -> Option<&C>[src]

Get a column reference if it exists

fn has_col<C: Col>() -> bool[src]

Check for presence of a particular column

fn is_disjoint<H: Header>() -> bool[src]

Are there any columns in common?

fn clone_from_rec_unchecked(_: &impl Record) -> Self[src]

Provided methods

fn col_ref<C: Col>(&self) -> &C where
    Self: HasCol<C>, 
[src]

Get a column reference; the type bound statically ensures it exists

fn clone_from_rec<R>(rec: &R) -> Self where
    HCons<SubsetP, HCons<Quote<Self>, HCons<Quote<R::Cols>, HNil>>>: Pass,
    R: Record
[src]

Implementations on Foreign Types

impl Header for HNil[src]

fn col_opt<C: Col>(&self) -> Option<&C>[src]

fn has_col<C: Col>() -> bool[src]

fn is_disjoint<H: Header>() -> bool[src]

fn clone_from_rec_unchecked(_: &impl Record) -> Self[src]

impl<H: Col, T: Header> Header for HCons<H, T> where
    HCons<Is, HCons<Missing, HCons<HCons<Find, HCons<Quote<H>, HCons<Quote<T>, HNil>>>, HNil>>>: Pass,
    Self: List
[src]

fn col_opt<C: Col>(&self) -> Option<&C>[src]

fn has_col<C: Col>() -> bool[src]

fn is_disjoint<Other: Header>() -> bool[src]

fn clone_from_rec_unchecked(r: &impl Record) -> Self[src]

Implementors