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: DurationThe interval duration between events
config: ProducerConfig<SystemTime>Configuration for the producer
Implementations§
Source§impl IntervalProducer
impl IntervalProducer
Sourcepub fn new(interval: Duration) -> Self
pub fn new(interval: Duration) -> Self
Creates a new IntervalProducer with the given interval.
§Arguments
interval- The duration between emitted events
Sourcepub fn with_error_strategy(self, strategy: ErrorStrategy<SystemTime>) -> Self
pub fn with_error_strategy(self, strategy: ErrorStrategy<SystemTime>) -> Self
Sets the error handling strategy.
Trait Implementations§
Source§impl Output for IntervalProducer
impl Output for IntervalProducer
Source§type Output = SystemTime
type Output = SystemTime
The type of items produced by this output stream.
Source§type OutputStream = Pin<Box<dyn Stream<Item = SystemTime> + Send>>
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
impl Producer for IntervalProducer
Source§type OutputPorts = (SystemTime,)
type OutputPorts = (SystemTime,)
The output port tuple type for this producer. Read more
Source§fn produce(&mut self) -> Self::OutputStream
fn produce(&mut self) -> Self::OutputStream
Produces a stream of items. Read more
Source§fn set_config_impl(&mut self, config: ProducerConfig<SystemTime>)
fn set_config_impl(&mut self, config: ProducerConfig<SystemTime>)
Sets the configuration implementation. Read more
Source§fn get_config_impl(&self) -> &ProducerConfig<SystemTime>
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>
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
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>
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
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>)
fn set_config(&mut self, config: ProducerConfig<Self::Output>)
Sets the configuration for this producer. Read more
Source§fn config(&self) -> &ProducerConfig<Self::Output>
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>
fn config_mut(&mut self) -> &mut ProducerConfig<Self::Output>
Returns a mutable reference to the producer’s configuration. Read more
Auto Trait Implementations§
impl Freeze for IntervalProducer
impl !RefUnwindSafe for IntervalProducer
impl Send for IntervalProducer
impl Sync for IntervalProducer
impl Unpin for IntervalProducer
impl !UnwindSafe for IntervalProducer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<P> ProducerPorts for P
impl<P> ProducerPorts for P
Source§type DefaultOutputPorts = (<P as Output>::Output,)
type DefaultOutputPorts = (<P as Output>::Output,)
The default output port tuple type (single port with the producer’s output type).