export Magic<>
This commit is contained in:
14
src/lib.rs
14
src/lib.rs
@@ -14,15 +14,15 @@ extern crate alloc;
|
|||||||
|
|
||||||
mod impls {
|
mod impls {
|
||||||
|
|
||||||
mod primitives;
|
pub mod primitives;
|
||||||
|
|
||||||
mod magic;
|
pub mod magic;
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
mod lib_alloc;
|
pub mod lib_alloc;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
mod lib_std;
|
pub mod lib_std;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,6 @@ pub trait Reader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use derive_macro::OverTheWire;
|
|
||||||
|
|
||||||
pub trait OverTheWire: Sized {
|
pub trait OverTheWire: Sized {
|
||||||
fn serialize<T: Writer>(&self, writer: &mut T) -> e::Result<()>;
|
fn serialize<T: Writer>(&self, writer: &mut T) -> e::Result<()>;
|
||||||
@@ -65,6 +64,11 @@ pub trait OverTheWire: Sized {
|
|||||||
fn size_hint() -> usize;
|
fn size_hint() -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//╶───╴Util / Re-exports╶────────────────────────────────────────────────────╴
|
||||||
|
|
||||||
|
pub use derive_macro::OverTheWire;
|
||||||
|
pub use impls::magic::Magic;
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn min_wire_size<T: OverTheWire>() -> usize {
|
pub fn min_wire_size<T: OverTheWire>() -> usize {
|
||||||
T::size_hint()
|
T::size_hint()
|
||||||
|
|||||||
Reference in New Issue
Block a user