use std::borrow::Cow;
use std::fmt;
use std::fmt::Debug;
use vortex_array::DeserializeMetadata;
use vortex_array::SerializeMetadata;
use vortex_error::VortexResult;
use vortex_session::registry::Id;
use crate::plan::PlanChildren;
use crate::plan::typed::Plan;
pub type PlanId = Id;
pub trait PlanVTable: 'static + Clone + Sized + Send + Sync + Debug {
type PlanData: 'static + Send + Sync + Clone + Debug;
type Metadata: SerializeMetadata + DeserializeMetadata + Debug;
fn id(&self) -> PlanId;
fn fmt(plan: &Plan<Self>, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
let _ = (plan, formatter);
Ok(())
}
fn metadata(plan: &Plan<Self>) -> Option<Self::Metadata>;
fn with_children(
plan: &Plan<Self>,
children: &PlanChildren,
data: &mut Self::PlanData,
) -> VortexResult<()> {
let _ = (plan, children, data);
Ok(())
}
fn child_name(plan: &Plan<Self>, index: usize) -> Cow<'_, str> {
let _ = plan;
Cow::Owned(format!("child[{index}]"))
}
}