pub trait Reducer:
Send
+ Sync
+ Clone
+ 'static {
type Dtype: PolarsDataType;
type Value: Clone + Send + Sync + 'static;
// Required methods
fn init(&self) -> Self::Value;
fn combine(&self, a: &mut Self::Value, b: &Self::Value);
fn reduce_one(
&self,
a: &mut Self::Value,
b: Option<<Self::Dtype as PolarsDataType>::Physical<'_>>,
);
fn reduce_ca(&self, v: &mut Self::Value, ca: &ChunkedArray<Self::Dtype>);
fn finish(
&self,
v: Vec<Self::Value>,
m: Option<Bitmap>,
dtype: &DataType,
) -> PolarsResult<Series>;
// Provided method
fn cast_series<'a>(&self, s: &'a Series) -> Cow<'a, Series> { ... }
}
Required Associated Types§
Required Methods§
fn init(&self) -> Self::Value
fn combine(&self, a: &mut Self::Value, b: &Self::Value)
fn reduce_one( &self, a: &mut Self::Value, b: Option<<Self::Dtype as PolarsDataType>::Physical<'_>>, )
fn reduce_ca(&self, v: &mut Self::Value, ca: &ChunkedArray<Self::Dtype>)
fn finish( &self, v: Vec<Self::Value>, m: Option<Bitmap>, dtype: &DataType, ) -> PolarsResult<Series>
Provided Methods§
fn cast_series<'a>(&self, s: &'a Series) -> Cow<'a, Series>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.