public some traits and functions

This commit is contained in:
Horhik 2021-02-28 00:54:02 +03:00
parent aac3e3a76b
commit a4c1d2c0b5
4 changed files with 9 additions and 10 deletions

View file

@ -1,5 +1,5 @@
[package]
name = "FCPv2"
name = "fcpv2"
version = "0.0.1"
authors = ["Horhik <horhik@tuta.io>"]
edition = "2018"

View file

@ -1,5 +1,6 @@
mod types;
use types::fcp_types;
pub use types::client;
pub use types::node;
#[cfg(test)]
mod tests {

View file

@ -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<T> {
pub trait FcpParser<T> {
fn parse(palin: &str) -> Option<T>;
}
impl FcpParser<SSK> 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(),

View file

@ -1,4 +1,2 @@
mod client;
mod node;
pub use client::*;
pub mod client;
pub mod node;