drogue_network/
lib.rs

1#![cfg_attr(not(test), no_std)]
2
3//#![deny(missing_docs)]
4#![deny(unsafe_code)]
5
6pub mod tcp;
7//mod udp;
8pub mod dns;
9pub mod addr;
10
11use tcp::TcpStack;
12
13use core::fmt::Debug;
14use crate::tcp::TcpError;
15use crate::dns::{DnsError, Dns};
16
17/// Aggregation and homegenation of IP network stacks
18pub trait IpNetworkDriver {
19    type TcpSocket;
20    type TcpError: Into<TcpError> + Debug;
21
22    type DnsError: Into<DnsError> + Debug;
23
24    //type UdpSocket;
25    //type UdpError: Into<UdpError> + Debug;
26
27    fn tcp(&self) -> &dyn TcpStack<TcpSocket=Self::TcpSocket, Error=Self::TcpError>;
28    //fn udp() -> &dyn UdpStack<Error = NetworkError>;
29    fn dns(&self) -> &dyn Dns<Error=Self::DnsError>;
30}
31