diff options
author | hozan23 <hozan23@karyontech.net> | 2024-05-19 23:41:31 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-05-19 23:41:31 +0200 |
commit | f6f44784fff5488bb59d563ee7ff7b94c08a48c1 (patch) | |
tree | 63fa6fa0d620748a92d819f4773773ea9d53afc5 /net/src/lib.rs | |
parent | a6016c7eeb11fc8aeaa1a3b160b970b15362695d (diff) |
use cargo features to enable/disable protocols for net crate
Diffstat (limited to 'net/src/lib.rs')
-rw-r--r-- | net/src/lib.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/src/lib.rs b/net/src/lib.rs index ddb53cf..cd5fc8b 100644 --- a/net/src/lib.rs +++ b/net/src/lib.rs @@ -3,6 +3,7 @@ mod connection; mod endpoint; mod error; mod listener; +#[cfg(feature = "stream")] mod stream; mod transports; @@ -10,9 +11,23 @@ pub use { connection::{Conn, Connection, ToConn}, endpoint::{Addr, Endpoint, Port, ToEndpoint}, listener::{ConnListener, Listener, ToListener}, - transports::{tcp, tls, udp, unix, ws}, }; +#[cfg(feature = "tcp")] +pub use transports::tcp; + +#[cfg(feature = "tls")] +pub use transports::tls; + +#[cfg(feature = "ws")] +pub use transports::ws; + +#[cfg(feature = "udp")] +pub use transports::udp; + +#[cfg(all(feature = "unix", target_family = "unix"))] +pub use transports::unix; + /// Represents karyon's Net Error pub use error::Error; |