echonet_lite/
lib.rs

1//! This crate is pure Rust ECHONET Lite implementation including
2//! - serde implementation of ECHONET Lite packet
3//! - detailed property configurations of ECHONET Device objects (WIP)
4//!
5//! but not included
6//! - transport layer (usually, UDP with IPv4/IPv6) implementation
7//! - specific ECHONET Lite object behavior
8
9#![cfg_attr(not(feature = "std"), no_std)]
10extern crate alloc;
11
12/// All the types we need from `std`, `core`, and `alloc` crates.
13mod lib {
14    mod core {
15        #[cfg(not(feature = "std"))]
16        pub use core::*;
17        #[cfg(feature = "std")]
18        pub use std::*;
19    }
20
21    pub use self::core::clone::{self, Clone};
22    pub use self::core::convert::{self, From, Into};
23    pub use self::core::default::{self, Default};
24    pub use self::core::fmt::{self, Debug, Display};
25    pub use self::core::result::{self, Result};
26    pub use self::core::{ops, str};
27
28    #[cfg(not(feature = "std"))]
29    pub use alloc::string::{String, ToString};
30    #[cfg(feature = "std")]
31    pub use std::string::{String, ToString};
32
33    #[cfg(not(feature = "std"))]
34    pub use alloc::vec::{self, Vec};
35    #[cfg(feature = "std")]
36    pub use std::vec::{self, Vec};
37
38    #[cfg(not(feature = "std"))]
39    pub use alloc::boxed::Box;
40    #[cfg(feature = "std")]
41    pub use std::boxed::Box;
42
43    #[cfg(feature = "std")]
44    pub use std::error;
45
46    #[cfg(feature = "std")]
47    pub use std::io;
48}
49
50mod el_packet;
51mod error;
52mod io;
53
54mod de;
55mod ser;
56pub use de::deserialize;
57pub use ser::serialize;
58pub mod object;
59pub mod prelude;
60pub use el_packet::*;
61pub use error::{Error, ErrorKind, Result};