serde_hkx/
lib.rs

1pub mod bytes;
2pub mod errors;
3pub mod prelude;
4mod sort;
5pub mod tree;
6pub mod xml;
7
8#[cfg(test)]
9pub(crate) mod tests;
10
11/// A facade around all the types we need from the `std`, `core`, and `alloc`
12/// crates. This avoids elaborate import wrangling having to happen in every
13/// module.
14mod lib {
15    mod core {
16        pub use core::*;
17    }
18
19    pub use self::core::f32;
20    pub use self::core::fmt;
21    pub use self::core::fmt::Display;
22    pub use self::core::ops::Range;
23    pub use self::core::str;
24    pub use self::core::str::FromStr;
25
26    pub use std::string::{String, ToString};
27}
28
29/// Avoiding type inference by the compiler, such as `?` and `into`, can speed up compile
30/// time by a small amount, so use macros to avoid type inference.
31///
32/// # Info
33/// This is a hack I learned at serde.
34macro_rules! tri {
35    ($expr:expr) => {
36        match $expr {
37            Ok(val) => val,
38            Err(err) => return Err(err),
39        }
40    };
41}
42pub(crate) use tri;
43
44pub use crate::bytes::de::from_bytes;
45pub use crate::bytes::ser::to_bytes;
46pub use crate::sort::HavokSort;
47pub use crate::xml::de::from_str;
48pub use crate::xml::ser::to_string;