Begin splitting net out into net (common), client, server, and manager crates

feat/RusshSupport
Chip Senkbeil 7 months ago
parent 285ee190c4
commit fc67e9e693
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

42
Cargo.lock generated

@ -825,8 +825,11 @@ dependencies = [
"bitflags 2.4.0",
"bytes",
"derive_more",
"distant-core-client",
"distant-core-manager",
"distant-core-net",
"distant-core-protocol",
"distant-core-server",
"distant-plugin",
"env_logger",
"futures",
@ -857,6 +860,32 @@ dependencies = [
"tokio",
]
[[package]]
name = "distant-core-client"
version = "0.21.0"
dependencies = [
"async-trait",
"derive_more",
"env_logger",
"log",
"serde",
"test-log",
"tokio",
]
[[package]]
name = "distant-core-manager"
version = "0.21.0"
dependencies = [
"async-trait",
"derive_more",
"env_logger",
"log",
"serde",
"test-log",
"tokio",
]
[[package]]
name = "distant-core-net"
version = "0.21.0"
@ -906,6 +935,19 @@ dependencies = [
"strum",
]
[[package]]
name = "distant-core-server"
version = "0.21.0"
dependencies = [
"async-trait",
"derive_more",
"env_logger",
"log",
"serde",
"test-log",
"tokio",
]
[[package]]
name = "distant-plugin"
version = "0.21.0"

@ -15,8 +15,11 @@ license = "MIT OR Apache-2.0"
members = [
"distant-core",
"distant-core-auth",
"distant-core-client",
"distant-core-manager",
"distant-core-net",
"distant-core-protocol",
"distant-core-server",
"distant-plugin",
"distant-plugin-local",
"distant-plugin-ssh",

@ -0,0 +1,23 @@
[package]
name = "distant-core-client"
description = "Core client library for distant, providing mechanisms to connect to a distant-compatible server"
categories = ["network-programming"]
keywords = ["client", "network", "distant"]
version = "0.21.0"
authors = ["Chip Senkbeil <chip@senkbeil.org>"]
edition = "2021"
homepage = "https://github.com/chipsenkbeil/distant"
repository = "https://github.com/chipsenkbeil/distant"
readme = "README.md"
license = "MIT OR Apache-2.0"
[dependencies]
async-trait = "0.1.68"
derive_more = { version = "0.99.17", default-features = false, features = ["display", "from", "error"] }
log = "0.4.18"
serde = { version = "1.0.163", features = ["derive"] }
[dev-dependencies]
env_logger = "0.10.0"
test-log = "0.2.11"
tokio = { version = "1.28.2", features = ["full"] }

@ -0,0 +1,23 @@
[package]
name = "distant-core-manager"
description = "Core manager library for distant, providing client & server implementation of a manager"
categories = ["network-programming"]
keywords = ["client", "server", "manager", "network", "distant"]
version = "0.21.0"
authors = ["Chip Senkbeil <chip@senkbeil.org>"]
edition = "2021"
homepage = "https://github.com/chipsenkbeil/distant"
repository = "https://github.com/chipsenkbeil/distant"
readme = "README.md"
license = "MIT OR Apache-2.0"
[dependencies]
async-trait = "0.1.68"
derive_more = { version = "0.99.17", default-features = false, features = ["display", "from", "error"] }
log = "0.4.18"
serde = { version = "1.0.163", features = ["derive"] }
[dev-dependencies]
env_logger = "0.10.0"
test-log = "0.2.11"
tokio = { version = "1.28.2", features = ["full"] }

@ -0,0 +1,23 @@
[package]
name = "distant-core-server"
description = "Core server library for distant, providing distant-compatible server implementation"
categories = ["network-programming"]
keywords = ["server", "network", "distant"]
version = "0.21.0"
authors = ["Chip Senkbeil <chip@senkbeil.org>"]
edition = "2021"
homepage = "https://github.com/chipsenkbeil/distant"
repository = "https://github.com/chipsenkbeil/distant"
readme = "README.md"
license = "MIT OR Apache-2.0"
[dependencies]
async-trait = "0.1.68"
derive_more = { version = "0.99.17", default-features = false, features = ["display", "from", "error"] }
log = "0.4.18"
serde = { version = "1.0.163", features = ["derive"] }
[dev-dependencies]
env_logger = "0.10.0"
test-log = "0.2.11"
tokio = { version = "1.28.2", features = ["full"] }

@ -17,6 +17,9 @@ bitflags = "2.3.1"
bytes = "1.4.0"
derive_more = { version = "0.99.17", default-features = false, features = ["as_mut", "as_ref", "deref", "deref_mut", "display", "from", "error", "into", "into_iterator", "is_variant", "try_into"] }
distant-core-net = { version = "=0.21.0", path = "../distant-core-net" }
distant-core-client = { version = "=0.21.0", path = "../distant-core-client" }
distant-core-manager = { version = "=0.21.0", path = "../distant-core-manager" }
distant-core-server = { version = "=0.21.0", path = "../distant-core-server" }
distant-plugin = { version = "=0.21.0", path = "../distant-plugin" }
distant-core-protocol = { version = "=0.21.0", path = "../distant-core-protocol" }
futures = "0.3.28"

@ -1,3 +1,5 @@
use std::io;
use async_trait::async_trait;
/// Type abstraction of a boxed [`Ctx`].
@ -6,4 +8,13 @@ pub type BoxedCtx = Box<dyn Ctx>;
/// Represents a context associated when an API request is being executed, supporting the ability
/// to send responses back asynchronously.
#[async_trait]
pub trait Ctx: Send {}
pub trait Ctx: Send {
/// Id of the connection associated with this context.
fn connection(&self) -> u32;
/// Clones context, returning a new boxed instance.
fn clone_ctx(&self) -> BoxedCtx;
/// Sends some response back.
fn send(&self, data: Vec<u8>) -> io::Result<()>;
}

@ -0,0 +1,5 @@
use async_trait::async_trait;
///
#[async_trait]
pub trait Client {}

@ -5,6 +5,7 @@
pub struct ReadmeDoctests;
pub mod api;
pub mod client;
pub mod common;
pub mod handlers;

Loading…
Cancel
Save