From ad4a4b4c3d9a7420d2ab59b2c57452303c42c174 Mon Sep 17 00:00:00 2001 From: ennucore Date: Wed, 1 Apr 2020 13:45:59 +0300 Subject: [PATCH] Ways --- src/error.rs | 1 - src/lib.rs | 3 ++- src/transport.rs | 4 +++- src/ways/mod.rs | 8 ++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) delete mode 100644 src/error.rs create mode 100644 src/ways/mod.rs diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 2d93388..0000000 --- a/src/error.rs +++ /dev/null @@ -1 +0,0 @@ -pub trait Error {} diff --git a/src/lib.rs b/src/lib.rs index 8681890..0f0f9d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,9 +10,10 @@ mod ironforce; mod transport; mod message; mod crypto; -mod error; mod way; mod tunnel; +#[cfg(feature = "std")] +mod ways; #[cfg(test)] mod tests { diff --git a/src/transport.rs b/src/transport.rs index 9e167c1..6f6150e 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -4,6 +4,8 @@ use crate::message::MsgType; use crate::crypto::PublicKey; #[cfg(feature = "std")] use crate::way::Way; +#[cfg(feature = "std")] +use crate::ways::get_all_possible_ways; #[cfg(feature = "std")] use std::thread; @@ -51,7 +53,7 @@ impl Transport { #[cfg(feature = "std")] impl Transport { pub fn new() -> Self { - let transport = Self { ways: Vec::>::new(), msg_pool: Vec::<(Message, PublicKey)>::new() }; + let transport = Self { ways: get_all_possible_ways(), msg_pool: Vec::<(Message, PublicKey)>::new() }; transport } diff --git a/src/ways/mod.rs b/src/ways/mod.rs new file mode 100644 index 0000000..5e0365d --- /dev/null +++ b/src/ways/mod.rs @@ -0,0 +1,8 @@ +use alloc::vec::Vec; +use alloc::boxed::Box; +use crate::way::Way; + + +pub fn get_all_possible_ways() -> Vec> { + Vec::>::new() +}