From a4c1d2c0b5eb79a3b25dc8386a0ec0f09a6374aa Mon Sep 17 00:00:00 2001 From: Horhik Date: Sun, 28 Feb 2021 00:54:02 +0300 Subject: [PATCH] public some traits and functions --- Cargo.toml | 2 +- src/lib.rs | 3 ++- src/types/client/fcp_types.rs | 8 ++++---- src/types/mod.rs | 6 ++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e497bba..94272ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "FCPv2" +name = "fcpv2" version = "0.0.1" authors = ["Horhik "] edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index b76239b..59035d0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ mod types; -use types::fcp_types; +pub use types::client; +pub use types::node; #[cfg(test)] mod tests { diff --git a/src/types/client/fcp_types.rs b/src/types/client/fcp_types.rs index 8be5941..e6a49f7 100644 --- a/src/types/client/fcp_types.rs +++ b/src/types/client/fcp_types.rs @@ -2,7 +2,7 @@ use super::types::*; use regex::Regex; impl ClientHello { - fn new(name: String, exp_ver: f32) -> Self { + pub fn new(name: String, exp_ver: f32) -> Self { ClientHello { name: name, expected_version: exp_ver, @@ -15,7 +15,7 @@ impl FcpRequest for ClientHello { return format!( "ClientHello\n\ Name={}\n\ - ExpectedVersion={}\n\ + ExpectedVersion={:?}\n\ EndMessage\n\n", self.name, self.expected_version ); @@ -176,7 +176,7 @@ fn is_keypair_parsing() { ) } -trait FcpParser { +pub trait FcpParser { fn parse(palin: &str) -> Option; } impl FcpParser for SSK { @@ -393,7 +393,7 @@ impl FcpRequest for ClientPut { } impl ClientPut { - fn new_default(uri: SSK, filename: &str, identifier: &str, data: &str) -> ClientPut { + pub fn new_default(uri: SSK, filename: &str, identifier: &str, data: &str) -> ClientPut { ClientPut { uri: uri, data_length: data.len(), diff --git a/src/types/mod.rs b/src/types/mod.rs index f0b2737..ac7f17d 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1,4 +1,2 @@ -mod client; -mod node; - -pub use client::*; +pub mod client; +pub mod node;