pub enum ResamplingFunction<T: Div<Output = T> + Sum + Default + Debug, S: Sample<Value = T>> {
Average,
Sum,
Max,
Min,
First,
Last,
Coalesce,
Count,
Custom(Box<dyn ClonableFnMut<S, T>>),
}Expand description
The ResamplingFunction enum represents the different resampling functions that can be used to resample a channel.
Variants§
Average
Calculates the average of all samples in the time step (ignoring None values)
Sum
Calculates the sum of all samples in the time step (ignoring None values)
Max
Calculates the maximum value of all samples in the time step (ignoring None values)
Min
Calculates the minimum value of all samples in the time step (ignoring None values)
First
Uses the first sample in the time step. If the first sample is None, the resampling function will return None.
Last
Uses the last sample in the time step. If the last sample is None, the resampling function will return None.
Coalesce
Returns the first non-None sample in the time step. If all samples are None, the resampling function will return None.
Count
Counts the number of samples in the time step (ignoring None values)
Custom(Box<dyn ClonableFnMut<S, T>>)
A custom resampling function that takes a closure that takes a slice of samples and returns an optional value.
Implementations§
Source§impl<T: Div<Output = T> + Sum + PartialOrd + FromPrimitive + Default + Debug, S: Sample<Value = T>> ResamplingFunction<T, S>
impl<T: Div<Output = T> + Sum + PartialOrd + FromPrimitive + Default + Debug, S: Sample<Value = T>> ResamplingFunction<T, S>
Trait Implementations§
Source§impl<T, S> Clone for ResamplingFunction<T, S>
impl<T, S> Clone for ResamplingFunction<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for ResamplingFunction<T, S>
impl<T, S> !RefUnwindSafe for ResamplingFunction<T, S>
impl<T, S> Send for ResamplingFunction<T, S>
impl<T, S> Sync for ResamplingFunction<T, S>
impl<T, S> Unpin for ResamplingFunction<T, S>
impl<T, S> !UnwindSafe for ResamplingFunction<T, S>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more