mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-13 06:20:02 -04:00
add wisp lib
This commit is contained in:
parent
48e9836515
commit
ad7a34e86d
10 changed files with 857 additions and 255 deletions
25
wisp/src/lib.rs
Normal file
25
wisp/src/lib.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
mod packet;
|
||||
mod ws;
|
||||
|
||||
pub use crate::packet::*;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Role {
|
||||
Client,
|
||||
Server,
|
||||
}
|
||||
|
||||
pub enum WispError {
|
||||
PacketTooSmall,
|
||||
InvalidPacketType,
|
||||
WsFrameInvalidType,
|
||||
WsFrameNotFinished,
|
||||
WsImplError(Box<dyn std::error::Error>),
|
||||
Utf8Error(std::str::Utf8Error),
|
||||
}
|
||||
|
||||
impl From<std::str::Utf8Error> for WispError {
|
||||
fn from(err: std::str::Utf8Error) -> WispError {
|
||||
WispError::Utf8Error(err)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue