From f8304bf6790e0677324a8984173eae9b2fde261a Mon Sep 17 00:00:00 2001 From: pythcoiner <124568858+pythcoiner@users.noreply.github.com> Date: Sun, 21 Jul 2024 02:47:06 +0200 Subject: [PATCH] make codec + Encode public (#11) * make codec public * make trait Encode public --- src/codec/mod.rs | 2 +- src/lib.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/codec/mod.rs b/src/codec/mod.rs index 2fd94f7..5c0d493 100644 --- a/src/codec/mod.rs +++ b/src/codec/mod.rs @@ -215,7 +215,7 @@ impl<'r> TryFrom<&'r [u8]> for Response<'r> { } /// Encode a struct into a buffer. -trait Encode { +pub trait Encode { fn encode(&self, buf: &mut [u8]) -> Result; } diff --git a/src/lib.rs b/src/lib.rs index ead8618..7548311 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,6 @@ mod codec; mod error; mod frame; -pub use codec::rtu; -pub use codec::tcp; +pub use codec::*; pub use error::*; pub use frame::*;