1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::crypto::Method;

pub use codec::{Codec, NsonCodec};
pub use network::{Packet, NetWork};
pub use keepalive::KeepAlive;

mod codec;
mod network;
mod keepalive;
pub mod tcp_ext;

#[derive(Debug, Clone)]
pub struct CryptoOptions {
    pub method: Method,
    pub secret: String
}

impl CryptoOptions {
    pub fn new(method: Method, secret: &str) -> CryptoOptions {
        CryptoOptions {
            method,
            secret: secret.to_string()
        }
    }
}