SkipTransformer

Struct SkipTransformer 

Source
pub struct SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static,
{ pub skip: usize, pub config: TransformerConfig<T>, pub _phantom: PhantomData<T>, }
Expand description

A transformer that skips a specified number of items from the beginning of a stream.

This transformer discards the first skip items and then passes through all subsequent items.

Fields§

§skip: usize

The number of items to skip from the beginning of the stream.

§config: TransformerConfig<T>

Configuration for the transformer, including error handling strategy.

§_phantom: PhantomData<T>

Phantom data to track the type parameter.

Implementations§

Source§

impl<T> SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static,

Source

pub fn new(skip: usize) -> Self

Creates a new SkipTransformer with the given skip count.

§Arguments
  • skip - The number of items to skip from the beginning of the stream.
Source

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

Sets the error handling strategy for this transformer.

§Arguments
  • strategy - The error handling strategy to use.
Source

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

Sets the name for this transformer.

§Arguments
  • name - The name to assign to this transformer.

Trait Implementations§

Source§

impl<T> Clone for SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static + Clone,

Source§

fn clone(&self) -> SkipTransformer<T>

Returns a duplicate 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<T> Input for SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static,

Source§

type Input = T

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

type InputStream = Pin<Box<dyn Stream<Item = T> + Send>>

The input stream type that yields items of type Self::Input.
Source§

impl<T> Output for SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static,

Source§

type Output = T

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

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

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

impl<T> Transformer for SkipTransformer<T>
where T: Debug + Clone + Send + Sync + 'static,

Source§

type InputPorts = (T,)

The input port tuple type for this transformer. Read more
Source§

type OutputPorts = (T,)

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

fn transform(&mut self, input: Self::InputStream) -> Self::OutputStream

Transforms a stream of input items into a stream of output items. Read more
Source§

fn set_config_impl(&mut self, config: TransformerConfig<T>)

Sets the configuration implementation. Read more
Source§

fn get_config_impl(&self) -> &TransformerConfig<T>

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

fn get_config_mut_impl(&mut self) -> &mut TransformerConfig<T>

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

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

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

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

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 with_config(&self, config: TransformerConfig<Self::Input>) -> Self
where Self: Sized + Clone,

Creates a new transformer instance with the given configuration. Read more
Source§

fn set_config(&mut self, config: TransformerConfig<Self::Input>)

Sets the configuration for this transformer. Read more
Source§

fn config(&self) -> &TransformerConfig<Self::Input>

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

fn config_mut(&mut self) -> &mut TransformerConfig<Self::Input>

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

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

Sets the name for this transformer. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SkipTransformer<T>

§

impl<T> !RefUnwindSafe for SkipTransformer<T>

§

impl<T> Send for SkipTransformer<T>

§

impl<T> Sync for SkipTransformer<T>

§

impl<T> Unpin for SkipTransformer<T>
where T: Unpin,

§

impl<T> !UnwindSafe for SkipTransformer<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> ToOwned for T
where T: Clone,

Source§

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 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V