use super::{ArrayOfDoublesSketch, CompactArrayOfDoublesSketch};
use apache_datasketches_sys::array_of_doubles_input::ArrayOfDoublesInputRef;
mod sealed {
pub trait Sealed {}
impl Sealed for super::ArrayOfDoublesSketch {}
impl Sealed for super::CompactArrayOfDoublesSketch {}
}
pub trait ArrayOfDoublesInput: sealed::Sealed {
#[doc(hidden)]
fn as_input(&self) -> ArrayOfDoublesInputRef<'_>;
fn get_num_values(&self) -> u8;
}
impl ArrayOfDoublesInput for ArrayOfDoublesSketch {
fn as_input(&self) -> ArrayOfDoublesInputRef<'_> {
ArrayOfDoublesInputRef::Sketch(&self.inner)
}
fn get_num_values(&self) -> u8 {
ArrayOfDoublesSketch::get_num_values(self)
}
}
impl ArrayOfDoublesInput for CompactArrayOfDoublesSketch {
fn as_input(&self) -> ArrayOfDoublesInputRef<'_> {
ArrayOfDoublesInputRef::Compact(&self.inner)
}
fn get_num_values(&self) -> u8 {
CompactArrayOfDoublesSketch::get_num_values(self)
}
}