#[derive(Debug, Clone)]
pub struct SortSpec {
estimated_rows: u64,
estimated_bytes: u64,
dedup: bool,
label: &'static str,
}
impl SortSpec {
#[must_use]
pub fn new(estimated_rows: u64, estimated_bytes: u64) -> Self {
Self {
estimated_rows,
estimated_bytes,
dedup: false,
label: "sort",
}
}
#[must_use]
pub fn with_dedup(mut self, dedup: bool) -> Self {
self.dedup = dedup;
self
}
#[must_use]
pub fn labelled(mut self, label: &'static str) -> Self {
self.label = label;
self
}
#[must_use]
pub fn estimated_rows(&self) -> u64 {
self.estimated_rows
}
#[must_use]
pub fn estimated_bytes(&self) -> u64 {
self.estimated_bytes
}
#[must_use]
pub fn dedup(&self) -> bool {
self.dedup
}
#[must_use]
pub fn label(&self) -> &'static str {
self.label
}
}