Skip to main content

TransformRequest

Trait TransformRequest 

Source
pub trait TransformRequest:
    Send
    + Sync
    + Debug
    + Clone {
    type Identifier: Send + Sync + Eq + Debug;
    type Input: Send + Clone;
    type Output: Send + Clone;

    // Required methods
    fn request_id(&self) -> Self::Identifier;
    fn input(&self) -> &Self::Input;
    fn get_dyn_configs(&self) -> Vec<(String, Vec<u8>)>;
}
Expand description

A trait representing a transformation request in shepherd-rs processing system. Each transformation request is a request to transform some input data into an output format. As such, the Input and Output types are generic, associated types allowing for flexibility in the types of data being transformed.

Required Associated Types§

Source

type Identifier: Send + Sync + Eq + Debug

A unique identifier for the transformation request. This needs to be unique across all transformation requests, across different shepherd-rs instances (process failures, etc.).

Source

type Input: Send + Clone

The type of the input for the transformation.

Source

type Output: Send + Clone

The type of the output expected after the transformation.

Required Methods§

Source

fn request_id(&self) -> Self::Identifier

Returns the unique identifier for the transformation request.

Source

fn input(&self) -> &Self::Input

Returns the input for the transformation request.

Source

fn get_dyn_configs(&self) -> Vec<(String, Vec<u8>)>

Given the TransformRequest is the latest in the stream, what dynamic configs need to be updated, Key is always a string, value is always a Vec<u8> representing the serialized value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§