Browse Source

Ways

master
Lev 5 years ago
parent
commit
ad4a4b4c3d
  1. 1
      src/error.rs
  2. 3
      src/lib.rs
  3. 4
      src/transport.rs
  4. 8
      src/ways/mod.rs

1
src/error.rs

@ -1 +0,0 @@
pub trait Error {}

3
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 {

4
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::<Box<dyn Way + Send + Sync>>::new(), msg_pool: Vec::<(Message, PublicKey)>::new() };
let transport = Self { ways: get_all_possible_ways(), msg_pool: Vec::<(Message, PublicKey)>::new() };
transport
}

8
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<Box<dyn Way + Send + Sync>> {
Vec::<Box<dyn Way + Send + Sync>>::new()
}
Loading…
Cancel
Save