websocket-std 0.0.6

Websocket implementation using std support, focus on microcontrollers and interoperability with other languages like C through the ffi.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fmt;

pub trait Serialize {
    fn serialize(&self) -> Vec<u8>;
}

#[derive(Debug)]
pub struct ParseError;

impl fmt::Display for ParseError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "Error parsing")
    }
}

pub trait Parse {
    fn parse(bytes: &[u8]) -> Result<Self, ParseError> where Self: Sized;
}