Move conn to core

This commit is contained in:
Joscha 2022-02-17 21:39:59 +01:00
parent c191262bd2
commit 939d9b7586
5 changed files with 20 additions and 3 deletions

8
Cargo.lock generated
View file

@ -86,9 +86,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
name = "cove-core"
version = "0.1.0"
dependencies = [
"futures",
"hex",
"log",
"rand",
"serde",
"serde_json",
"sha2",
"thiserror",
"tokio",
"tokio-stream",
"tokio-tungstenite",
]
[[package]]

View file

@ -4,6 +4,14 @@ version = "0.1.0"
edition = "2021"
[dependencies]
futures = "0.3.21"
hex = { version = "0.4.3", features = ["serde"] }
log = "0.4.14"
rand = "0.8.4"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.78"
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"

View file

@ -3,7 +3,6 @@ use std::sync::Arc;
use std::time::Duration;
use std::{fmt, io, result};
use cove_core::packets::Packet;
use futures::stream::{SplitSink, SplitStream};
use futures::StreamExt;
use log::debug;
@ -15,6 +14,8 @@ use tokio_stream::wrappers::UnboundedReceiverStream;
use tokio_tungstenite::tungstenite::{self, Message};
use tokio_tungstenite::WebSocketStream;
use crate::packets::Packet;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("IO error: {0}")]

View file

@ -1,3 +1,4 @@
pub mod conn;
mod id;
mod macros;
mod message;

View file

@ -1,6 +1,5 @@
// TODO Logging
mod conn;
mod util;
use std::collections::HashMap;
@ -8,7 +7,7 @@ use std::sync::Arc;
use std::time::Duration;
use anyhow::anyhow;
use conn::{ConnMaintenance, ConnRx, ConnTx};
use cove_core::conn::{self, ConnMaintenance, ConnRx, ConnTx};
use cove_core::packets::{
Cmd, HelloCmd, HelloRpl, JoinNtf, NickCmd, NickNtf, NickRpl, Packet, PartNtf, SendCmd, SendNtf,
SendRpl, WhoCmd, WhoRpl,