1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::connection_config::*;
use crate::connection_status::*;
use crate::receiver::*;
use crossbeam::channel::Sender;
use std::sync::{Arc, Mutex};

pub trait GenericConnection {
    fn open(&mut self) -> std::io::Result<()>;
    fn close(&self);
    fn get_config(&self) -> ConnectionConfig;
    fn get_status(&self) -> ConnectionStatus;
    fn get_receiver(&self) -> Arc<Mutex<Receiver>>;
    fn get_write_sender(&self) -> Option<Sender<Vec<u8>>>;
}