IntervalProducer

Struct IntervalProducer 

Source
pub struct IntervalProducer {
    pub interval: Duration,
    pub config: ProducerConfig<SystemTime>,
}
Expand description

A producer that emits events at regular intervals.

This producer generates timestamp events at the specified interval duration.

Fields§

§interval: Duration

The interval duration between events

§config: ProducerConfig<SystemTime>

Configuration for the producer

Implementations§

Source§

impl IntervalProducer

Source

pub fn new(interval: Duration) -> Self

Creates a new IntervalProducer with the given interval.

§Arguments
  • interval - The duration between emitted events
Source

pub fn with_error_strategy(self, strategy: ErrorStrategy<SystemTime>) -> Self

Sets the error handling strategy.

Source

pub fn with_name(self, name: String) -> Self

Sets the name for this producer.

Trait Implementations§

Source§

impl Output for IntervalProducer

Source§

type Output = SystemTime

The type of items produced by this output stream.
Source§

type OutputStream = Pin<Box<dyn Stream<Item = SystemTime> + Send>>

The output stream type that yields items of type Self::Output.
Source§

impl Producer for IntervalProducer

Source§

type OutputPorts = (SystemTime,)

The output port tuple type for this producer. Read more
Source§

fn produce(&mut self) -> Self::OutputStream

Produces a stream of items. Read more
Source§

fn set_config_impl(&mut self, config: ProducerConfig<SystemTime>)

Sets the configuration implementation. Read more
Source§

fn get_config_impl(&self) -> &ProducerConfig<SystemTime>

Returns a reference to the configuration implementation. Read more
Source§

fn get_config_mut_impl(&mut self) -> &mut ProducerConfig<SystemTime>

Returns a mutable reference to the configuration implementation. Read more
Source§

fn handle_error(&self, error: &StreamError<SystemTime>) -> ErrorAction

Handles an error that occurred during stream production. Read more
Source§

fn create_error_context( &self, item: Option<SystemTime>, ) -> ErrorContext<SystemTime>

Creates an error context for error reporting. Read more
Source§

fn component_info(&self) -> ComponentInfo

Returns information about the component for error reporting. Read more
Source§

fn set_config(&mut self, config: ProducerConfig<Self::Output>)

Sets the configuration for this producer. Read more
Source§

fn config(&self) -> &ProducerConfig<Self::Output>

Returns a reference to the producer’s configuration. Read more
Source§

fn config_mut(&mut self) -> &mut ProducerConfig<Self::Output>

Returns a mutable reference to the producer’s configuration. Read more
Source§

fn with_name(self, name: String) -> Self
where Self: Sized,

Sets the name for this producer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

Source§

impl<P> ProducerPorts for P
where P: Producer, <P as Output>::Output: Debug + Clone + Send + Sync,

Source§

type DefaultOutputPorts = (<P as Output>::Output,)

The default output port tuple type (single port with the producer’s output type).
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.