//! Configuration use super::*; pub const DEFAULT_BUFFER_SIZE: usize = 4096; /// Configuration for sending #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct SendConfig { encrypt: bool, compress: bool, buffer_size: usize, archive: bool, oneshot: bool, continuation: bool, } impl Default for SendConfig { #[inline] fn default() -> Self { Self { encrypt: false, compress: false, buffer_size: DEFAULT_BUFFER_SIZE, archive: false, oneshot: false, continuation: false, } } } /// Configuration for receiving #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct RecvConfig { interactive: bool, continuation: bool, } impl Default for RecvConfig { #[inline] fn default() -> Self { Self { interactive: false, continuation: false, } } } /// Program configuration #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Config { Send(SendConfig), Recv(RecvConfig), }