|
|
|
@ -1,9 +1,40 @@
|
|
|
|
|
use crate::message::{Message, MsgType}; |
|
|
|
|
use crate::way::Way; |
|
|
|
|
|
|
|
|
|
use alloc::vec::Vec; |
|
|
|
|
use alloc::boxed::Box; |
|
|
|
|
|
|
|
|
|
#[cfg(no_std)] |
|
|
|
|
pub struct Transport {} |
|
|
|
|
|
|
|
|
|
#[cfg(not(no_std))] |
|
|
|
|
pub struct Transport { |
|
|
|
|
ways: Vec<Box<dyn Way>> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[cfg(no_std)] |
|
|
|
|
impl Transport { |
|
|
|
|
pub fn new() -> Self { |
|
|
|
|
Self {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn send(&self, msg: &Message) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn receive(&self) -> Message { |
|
|
|
|
Message::new(MsgType::Service, |
|
|
|
|
Vec::<u8>::new(), |
|
|
|
|
&crate::crypto::KeyPack::gen()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[cfg(not(no_std))] |
|
|
|
|
impl Transport { |
|
|
|
|
pub fn new() -> Self { |
|
|
|
|
Self {ways: Vec::<Box<dyn Way>>::new()} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn send(&self, msg: &Message) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|