pub struct Periodic<Q, const PUSH_FIRST: bool> { /* private fields */ }
Expand description

Periodic Operator Builder.

Implementations§

source§

impl<Q, const PUSH_FIRST: bool> Periodic<Q, PUSH_FIRST>where Q: Queue,

source

pub fn new(queue: Q, period: Period) -> Self

Create a new periodic operator with the given queue.

source§

impl<Q> Periodic<Q, true>where Q: Queue, Q::Item: Clone,

source

pub fn build<I, P>(self, op: P) -> TumblingOperator<Q, Op<P, true>>where I: Tickable, P: PeriodicOp<I, Q::Item>,

Build the periodic operator.

source

pub fn build_fn<I, F>( self, f: F ) -> TumblingOperator<Q, Op<PeroidicFn<F>, true>>where I: Tickable, F: for<'a> FnMut(QueueRef<'a, Q::Item>, bool, I) -> Q::Item,

Build the periodic operator using the given closure.

source§

impl<Q> Periodic<Q, false>where Q: Queue,

source

pub fn build<I, P>(self, op: P) -> TumblingOperator<Q, Op<P, false>>where I: Tickable, P: PeriodicOp<I, Q::Item>,

Build periodic operator.

source

pub fn build_cache( self ) -> impl for<'out> GatOperator<Q::Item, Output<'out> = TickQueueRef<'out, Q::Item>>where Q: Queue + 'static, Q::Item: Tickable + 'static,

Build a cache operator.

source

pub fn build_fn<I, F>( self, f: F ) -> TumblingOperator<Q, Op<PeroidicFn<F>, false>>where I: Tickable, F: for<'a> FnMut(QueueRef<'a, Q::Item>, bool, I) -> Q::Item,

Build the periodic operator using the given closure.

source

pub fn push_first(self) -> Periodic<Q, true>where Q::Item: Clone,

Push before calculation.

source§

impl Periodic<(), false>

source

pub fn with_circular<T>( length: NonZeroUsize, period: Period ) -> Periodic<Circular<0, T>, false>

Create a new periodic operator builder using circular queue.

source

pub fn with_circular_n<const N: usize, T>( period: Period ) -> Periodic<Circular<N, T>, false>

Create a new periodic operator builder using circular queue.

Panic

Panic if N is zero.

Trait Implementations§

source§

impl<Q: Clone, const PUSH_FIRST: bool> Clone for Periodic<Q, PUSH_FIRST>

source§

fn clone(&self) -> Periodic<Q, PUSH_FIRST>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Q: Debug, const PUSH_FIRST: bool> Debug for Periodic<Q, PUSH_FIRST>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Q: Copy, const PUSH_FIRST: bool> Copy for Periodic<Q, PUSH_FIRST>

Auto Trait Implementations§

§

impl<Q, const PUSH_FIRST: bool> RefUnwindSafe for Periodic<Q, PUSH_FIRST>where Q: RefUnwindSafe,

§

impl<Q, const PUSH_FIRST: bool> Send for Periodic<Q, PUSH_FIRST>where Q: Send,

§

impl<Q, const PUSH_FIRST: bool> Sync for Periodic<Q, PUSH_FIRST>where Q: Sync,

§

impl<Q, const PUSH_FIRST: bool> Unpin for Periodic<Q, PUSH_FIRST>where Q: Unpin,

§

impl<Q, const PUSH_FIRST: bool> UnwindSafe for Periodic<Q, PUSH_FIRST>where Q: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.