use super::sealed::Sealed;
use super::wire_type::WireType;
pub trait WireSource: Sealed {
type Payload<'a>;
fn wire_type(payload: &Self::Payload<'_>) -> WireType;
fn column_name<'a>(payload: &'a Self::Payload<'_>) -> &'a str;
}
pub trait WireColumnTypes {
fn column_type(&self, column_index: usize) -> WireType;
}
pub trait WireSchema {
type Table: crate::schema::NamedColumns + WireColumnTypes;
fn get(&self, table_name: &str) -> Option<&Self::Table>;
}
pub trait Digestable<F, T, S, B>
where
F: crate::builders::Format<S, B>,
T: crate::schema::NamedColumns + WireColumnTypes,
{
type Src: WireSource;
type Error;
fn digest_into<Sch, A>(
&self,
builder: crate::builders::DiffSetBuilder<F, T, S, B>,
schema: &Sch,
adapter: &A,
) -> Result<crate::builders::DiffSetBuilder<F, T, S, B>, Self::Error>
where
Sch: WireSchema<Table = T>,
A: super::WireAdapter<Self::Src, S, B>;
}