Browse Source

ways

master
ennucore 5 years ago
parent
commit
458a148ab1
  1. 11
      src/transport.rs

11
src/transport.rs

@ -5,17 +5,20 @@ use alloc::vec::Vec;
use alloc::boxed::Box;
#[cfg(not(feature = "std"))]
pub struct Transport {}
pub struct Transport {
id: [u8; 64]
}
#[cfg(feature = "std")]
pub struct Transport {
ways: Vec<Box<dyn Way>>
ways: Vec<Box<dyn Way>>,
id: [u8; 64]
}
#[cfg(not(feature = "std"))]
impl Transport {
pub fn new() -> Self {
Self {}
Self {id: [0; 64]}
}
pub fn send(&self, msg: &Message) {
@ -32,7 +35,7 @@ impl Transport {
#[cfg(feature = "std")]
impl Transport {
pub fn new() -> Self {
Self {ways: Vec::<Box<dyn Way>>::new()}
Self {ways: Vec::<Box<dyn Way>>::new(), id: [0; 64]}
}
pub fn send(&self, msg: &Message) {

Loading…
Cancel
Save