PipelineRequirements

Struct PipelineRequirements 

Source
pub struct PipelineRequirements {
    pub compression_enabled: bool,
    pub encryption_enabled: bool,
    pub parallel_processing: bool,
    pub chunk_size_mb: usize,
    pub max_memory_mb: Option<usize>,
    pub target_throughput_mbps: Option<f64>,
}
Expand description

Pipeline requirements for optimization, security, and performance configuration.

PipelineRequirements is a value object that encapsulates all configuration requirements for pipeline operations, enabling adaptive optimization based on performance targets, security needs, and resource constraints.

§Key Features

  • Security Configuration: Encryption and compression requirement flags
  • Performance Tuning: Throughput targets and memory constraints
  • Resource Management: Chunk size and memory limit specification
  • Processing Mode: Parallel vs sequential processing configuration
  • Adaptive Optimization: Requirements guide automatic optimization decisions

§Configuration Categories

§Security Requirements

  • compression_enabled: Whether to apply compression to reduce storage/bandwidth
  • encryption_enabled: Whether to encrypt data for security compliance

§Performance Requirements

  • parallel_processing: Enable multi-threaded processing for performance
  • target_throughput_mbps: Target processing speed in megabytes per second

§Resource Requirements

  • chunk_size_mb: Processing chunk size for memory and I/O optimization
  • max_memory_mb: Maximum memory usage limit for resource-constrained environments

§Usage Patterns

§Integration with Pipeline System

The requirements integrate with various pipeline components:

  • Optimization Engine: Uses requirements to select optimal algorithms
  • Resource Manager: Enforces memory and processing constraints
  • Security Layer: Applies encryption and compression based on flags
  • Performance Monitor: Validates actual performance against targets

§Thread Safety

PipelineRequirements is thread-safe through immutability. All fields are read-only after construction, making it safe to share across threads without synchronization.

§Cross-Language Compatibility

The requirements structure maps well to other languages:

  • JSON: Direct serialization for configuration files and APIs
  • Go: Struct with similar field types and JSON tags
  • Python: Dataclass with type hints for configuration management
  • YAML: Configuration file format for deployment settings

§Performance Considerations

  • Lightweight value object with minimal memory overhead
  • Efficient serialization through serde derive macros
  • Immutable design eliminates defensive copying
  • Optional fields reduce memory usage when constraints are not specified

Fields§

§compression_enabled: bool

Whether compression should be applied to reduce storage and bandwidth usage

§encryption_enabled: bool

Whether encryption should be applied for data security and compliance

§parallel_processing: bool

Whether parallel processing should be used to improve performance

§chunk_size_mb: usize

Processing chunk size in megabytes for memory and I/O optimization

§max_memory_mb: Option<usize>

Maximum memory usage limit in megabytes (None = no limit)

§target_throughput_mbps: Option<f64>

Target throughput in megabytes per second (None = no target)

Trait Implementations§

Source§

impl Clone for PipelineRequirements

Source§

fn clone(&self) -> PipelineRequirements

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 Debug for PipelineRequirements

Source§

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

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

impl Default for PipelineRequirements

Source§

fn default() -> Self

Creates default pipeline requirements optimized for security and performance.

The default configuration provides a balanced approach suitable for most production environments, emphasizing security while maintaining good performance.

§Default Values
  • compression_enabled: true - Reduces storage and bandwidth usage
  • encryption_enabled: true - Ensures data security by default
  • parallel_processing: true - Leverages multi-core systems
  • chunk_size_mb: 1 - Conservative chunk size for memory efficiency
  • max_memory_mb: None - No memory limit (system-dependent)
  • target_throughput_mbps: None - No specific throughput target
§Examples
§Security by Default

The default configuration follows security best practices by enabling both compression and encryption. This ensures that data is protected and storage is optimized unless explicitly configured otherwise.

§Performance Considerations

While security is prioritized, the defaults also enable parallel processing to maintain good performance. The conservative 1MB chunk size balances memory usage with processing efficiency.

Source§

impl<'de> Deserialize<'de> for PipelineRequirements

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PipelineRequirements

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,