Move conn to core
This commit is contained in:
parent
c191262bd2
commit
939d9b7586
5 changed files with 20 additions and 3 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -86,9 +86,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
name = "cove-core"
|
name = "cove-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"futures",
|
||||||
"hex",
|
"hex",
|
||||||
|
"log",
|
||||||
|
"rand",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_json",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
|
"tokio-stream",
|
||||||
|
"tokio-tungstenite",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,14 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
futures = "0.3.21"
|
||||||
hex = { version = "0.4.3", features = ["serde"] }
|
hex = { version = "0.4.3", features = ["serde"] }
|
||||||
|
log = "0.4.14"
|
||||||
|
rand = "0.8.4"
|
||||||
serde = { version = "1.0.136", features = ["derive"] }
|
serde = { version = "1.0.136", features = ["derive"] }
|
||||||
|
serde_json = "1.0.78"
|
||||||
sha2 = "0.10.1"
|
sha2 = "0.10.1"
|
||||||
|
thiserror = "1.0.30"
|
||||||
|
tokio = { version = "1.16.1", features = ["full"] }
|
||||||
|
tokio-stream = "0.1.8"
|
||||||
|
tokio-tungstenite = "0.16.1"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::{fmt, io, result};
|
use std::{fmt, io, result};
|
||||||
|
|
||||||
use cove_core::packets::Packet;
|
|
||||||
use futures::stream::{SplitSink, SplitStream};
|
use futures::stream::{SplitSink, SplitStream};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
@ -15,6 +14,8 @@ use tokio_stream::wrappers::UnboundedReceiverStream;
|
||||||
use tokio_tungstenite::tungstenite::{self, Message};
|
use tokio_tungstenite::tungstenite::{self, Message};
|
||||||
use tokio_tungstenite::WebSocketStream;
|
use tokio_tungstenite::WebSocketStream;
|
||||||
|
|
||||||
|
use crate::packets::Packet;
|
||||||
|
|
||||||
#[derive(Debug, thiserror::Error)]
|
#[derive(Debug, thiserror::Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
#[error("IO error: {0}")]
|
#[error("IO error: {0}")]
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
pub mod conn;
|
||||||
mod id;
|
mod id;
|
||||||
mod macros;
|
mod macros;
|
||||||
mod message;
|
mod message;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
// TODO Logging
|
// TODO Logging
|
||||||
|
|
||||||
mod conn;
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
@ -8,7 +7,7 @@ use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use conn::{ConnMaintenance, ConnRx, ConnTx};
|
use cove_core::conn::{self, ConnMaintenance, ConnRx, ConnTx};
|
||||||
use cove_core::packets::{
|
use cove_core::packets::{
|
||||||
Cmd, HelloCmd, HelloRpl, JoinNtf, NickCmd, NickNtf, NickRpl, Packet, PartNtf, SendCmd, SendNtf,
|
Cmd, HelloCmd, HelloRpl, JoinNtf, NickCmd, NickNtf, NickRpl, Packet, PartNtf, SendCmd, SendNtf,
|
||||||
SendRpl, WhoCmd, WhoRpl,
|
SendRpl, WhoCmd, WhoRpl,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue