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/bandwidthencryption_enabled: Whether to encrypt data for security compliance
§Performance Requirements
parallel_processing: Enable multi-threaded processing for performancetarget_throughput_mbps: Target processing speed in megabytes per second
§Resource Requirements
chunk_size_mb: Processing chunk size for memory and I/O optimizationmax_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: boolWhether compression should be applied to reduce storage and bandwidth usage
encryption_enabled: boolWhether encryption should be applied for data security and compliance
parallel_processing: boolWhether parallel processing should be used to improve performance
chunk_size_mb: usizeProcessing 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
impl Clone for PipelineRequirements
Source§fn clone(&self) -> PipelineRequirements
fn clone(&self) -> PipelineRequirements
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PipelineRequirements
impl Debug for PipelineRequirements
Source§impl Default for PipelineRequirements
impl Default for PipelineRequirements
Source§fn default() -> Self
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 usageencryption_enabled:true- Ensures data security by defaultparallel_processing:true- Leverages multi-core systemschunk_size_mb:1- Conservative chunk size for memory efficiencymax_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
impl<'de> Deserialize<'de> for PipelineRequirements
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PipelineRequirements
impl RefUnwindSafe for PipelineRequirements
impl Send for PipelineRequirements
impl Sync for PipelineRequirements
impl Unpin for PipelineRequirements
impl UnwindSafe for PipelineRequirements
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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