You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
984 B

//! 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),
}