#![no_std]
#![warn(missing_docs)]
#![warn(deprecated_in_future)]
#![doc(test(attr(warn(unused))))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "test-serde")]
pub extern crate serde_json;
#[cfg(feature = "test-serde")]
pub extern crate bincode;
#[doc(hidden)]
pub mod rust_version {
include!(concat!(env!("OUT_DIR"), "/rust_version.rs"));
}
#[doc(hidden)]
pub mod _export {
#[cfg(feature = "alloc")]
pub extern crate alloc;
}
pub mod array;
pub mod array_vec;
pub mod compact_size;
pub mod const_tools;
pub mod error;
pub mod macros;
mod parse;
pub mod script;
pub mod slice;
pub mod wrap_debug;
#[cfg(feature = "serde")]
#[macro_use]
pub mod serde;
pub mod const_casts;
pub trait ToU64 {
fn to_u64(self) -> u64;
}
macro_rules! impl_to_u64 {
($($ty:ident),*) => {
$(
impl ToU64 for $ty { fn to_u64(self) -> u64 { self.into() } }
)*
}
}
impl_to_u64!(u8, u16, u32, u64);
impl ToU64 for usize {
fn to_u64(self) -> u64 {
crate::const_assert!(
core::mem::size_of::<usize>() <= 8;
"platforms that have usize larger than 64 bits are not supported"
);
self as u64
}
}