//! **Direction marker** — a small orthogonal taxonomy axis: does a surface PULL
//! data into the warehouse (a [`Direction::Source`], every [`Collector`](crate::Collector))
//! or ACCEPT data out of the pipeline (a [`Direction::Sink`], the
//! [`BatchSink`](crate::sink::BatchSink))? This is separate from the transport /
//! access-method family (`SourceKind`): a REST source and an OSM source are both
//! `Direction::Source` but different `SourceKind`s. Kept deliberately minimal — a
//! serde enum + a `CollectorMeta.direction` field — so the connectors
//! self-describe without overbuilding.
/// Data-flow direction of a connector surface.
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum Direction {
/// PULLS data IN (fetch/parse → Arrow). Every [`Collector`](crate::Collector).
Source,
/// ACCEPTS data OUT (Arrow → warehouse/Iceberg). The [`BatchSink`](crate::sink::BatchSink).
Sink,
/// Both directions (a read-write / CDC seam). Reserved; unused for now.
Duplex,
}
impl Direction {
/// Lowercase tag (`"source"` / `"sink"` / `"duplex"`) for JSON/UI surfaces.
pub fn as_str(self) -> &'static str {
match self {
Direction::Source => "source",
Direction::Sink => "sink",
Direction::Duplex => "duplex",
}
}
}