From 991e030a4f9f4b6cc9ea5d9c597636c0527a7c44 Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Sat, 10 Mar 2018 14:55:23 +0100 Subject: [PATCH] Started splitting out proto into its own crate. --- .gitignore | 2 ++ Cargo.toml | 4 +++ irc-proto/Cargo.toml | 24 +++++++++++++ {src/proto => irc-proto/src}/caps.rs | 0 {src/proto => irc-proto/src}/chan.rs | 0 {src/proto => irc-proto/src}/command.rs | 0 {src/proto => irc-proto/src}/irc.rs | 0 irc-proto/src/lib.rs | 46 ++++++++++++++++++++++++ {src/proto => irc-proto/src}/line.rs | 0 {src/proto => irc-proto/src}/message.rs | 0 {src/proto => irc-proto/src}/mode.rs | 0 {src/proto => irc-proto/src}/response.rs | 0 src/lib.rs | 1 - src/proto/mod.rs | 20 ----------- 14 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 irc-proto/Cargo.toml rename {src/proto => irc-proto/src}/caps.rs (100%) rename {src/proto => irc-proto/src}/chan.rs (100%) rename {src/proto => irc-proto/src}/command.rs (100%) rename {src/proto => irc-proto/src}/irc.rs (100%) create mode 100644 irc-proto/src/lib.rs rename {src/proto => irc-proto/src}/line.rs (100%) rename {src/proto => irc-proto/src}/message.rs (100%) rename {src/proto => irc-proto/src}/mode.rs (100%) rename {src/proto => irc-proto/src}/response.rs (100%) delete mode 100644 src/proto/mod.rs diff --git a/.gitignore b/.gitignore index 43fa6b8..c00c28f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /target +/irc-proto/target /Cargo.lock +/irc-proto/Cargo.lock *.json *.toml *.yaml diff --git a/Cargo.toml b/Cargo.toml index 61165ae..8938783 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,9 @@ travis-ci = { repository = "aatxe/irc" } is-it-maintained-issue-resolution = { repository = "aatxe/irc" } is-it-maintained-open-issues = { repository = "aatxe/irc" } +[workspace] +members = [ "./", "irc-proto" ] + [features] default = ["ctcp", "toml"] ctcp = [] @@ -29,6 +32,7 @@ chrono = "0.4" encoding = "0.2" failure = "0.1" futures = "0.1" +irc-proto = { version = "*", path = "irc-proto" } log = "0.3" native-tls = "0.1" serde = "1.0" diff --git a/irc-proto/Cargo.toml b/irc-proto/Cargo.toml new file mode 100644 index 0000000..18394dc --- /dev/null +++ b/irc-proto/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "irc-proto" +version = "0.1.0" +authors = ["Aaron Weiss "] + +[dependencies] +bufstream = "0.1" +bytes = "0.4" +chrono = "0.4" +encoding = "0.2" +failure = "0.1" +futures = "0.1" +log = "0.3" +native-tls = "0.1" +serde = "1.0" +serde_derive = "1.0" +serde_json = { version = "1.0", optional = true } +serde_yaml = { version = "0.7", optional = true } +tokio-core = "0.1" +tokio-io = "0.1" +tokio-mockstream = "1.1" +tokio-timer = "0.1" +tokio-tls = "0.1" +toml = { version = "0.4", optional = true } diff --git a/src/proto/caps.rs b/irc-proto/src/caps.rs similarity index 100% rename from src/proto/caps.rs rename to irc-proto/src/caps.rs diff --git a/src/proto/chan.rs b/irc-proto/src/chan.rs similarity index 100% rename from src/proto/chan.rs rename to irc-proto/src/chan.rs diff --git a/src/proto/command.rs b/irc-proto/src/command.rs similarity index 100% rename from src/proto/command.rs rename to irc-proto/src/command.rs diff --git a/src/proto/irc.rs b/irc-proto/src/irc.rs similarity index 100% rename from src/proto/irc.rs rename to irc-proto/src/irc.rs diff --git a/irc-proto/src/lib.rs b/irc-proto/src/lib.rs new file mode 100644 index 0000000..d9329f5 --- /dev/null +++ b/irc-proto/src/lib.rs @@ -0,0 +1,46 @@ +//! Support for the IRC protocol using Tokio. + +#![warn(missing_docs)] + +extern crate bufstream; +extern crate bytes; +extern crate chrono; +#[macro_use] +extern crate failure; +extern crate encoding; +#[macro_use] +extern crate futures; +#[macro_use] +extern crate log; +extern crate native_tls; +extern crate serde; +#[macro_use] +extern crate serde_derive; +#[cfg(feature = "json")] +extern crate serde_json; +#[cfg(feature = "yaml")] +extern crate serde_yaml; +extern crate tokio_core; +extern crate tokio_io; +extern crate tokio_mockstream; +extern crate tokio_timer; +extern crate tokio_tls; +#[cfg(feature = "toml")] +extern crate toml; + +pub mod caps; +pub mod chan; +pub mod command; +pub mod irc; +pub mod line; +pub mod message; +pub mod mode; +pub mod response; + +pub use self::caps::{Capability, NegotiationVersion}; +pub use self::chan::ChannelExt; +pub use self::command::{BatchSubCommand, CapSubCommand, Command}; +pub use self::irc::IrcCodec; +pub use self::message::Message; +pub use self::mode::{ChannelMode, Mode, UserMode}; +pub use self::response::Response; diff --git a/src/proto/line.rs b/irc-proto/src/line.rs similarity index 100% rename from src/proto/line.rs rename to irc-proto/src/line.rs diff --git a/src/proto/message.rs b/irc-proto/src/message.rs similarity index 100% rename from src/proto/message.rs rename to irc-proto/src/message.rs diff --git a/src/proto/mode.rs b/irc-proto/src/mode.rs similarity index 100% rename from src/proto/mode.rs rename to irc-proto/src/mode.rs diff --git a/src/proto/response.rs b/irc-proto/src/response.rs similarity index 100% rename from src/proto/response.rs rename to irc-proto/src/response.rs diff --git a/src/lib.rs b/src/lib.rs index 3c9d32d..ebc108b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,7 +68,6 @@ extern crate toml; pub mod client; pub mod error; -pub mod proto; const VERSION_STR: &str = concat!( env!("CARGO_PKG_NAME"), diff --git a/src/proto/mod.rs b/src/proto/mod.rs deleted file mode 100644 index e27925d..0000000 --- a/src/proto/mod.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! Support for the IRC protocol using Tokio. - -pub mod caps; -pub mod chan; -pub mod command; -pub mod colors; -pub mod irc; -pub mod line; -pub mod message; -pub mod mode; -pub mod response; - -pub use self::caps::{Capability, NegotiationVersion}; -pub use self::chan::ChannelExt; -pub use self::colors::FormattedStringExt; -pub use self::command::{BatchSubCommand, CapSubCommand, Command}; -pub use self::irc::IrcCodec; -pub use self::message::Message; -pub use self::mode::{ChannelMode, Mode, UserMode}; -pub use self::response::Response;