use std::io; use quiche::h3::webtransport; #[derive(Debug)] pub enum Error { Io(io::Error), Quiche(quiche::Error), WebTransport(webtransport::Error), Server(Server), } impl From for Error { fn from(err: io::Error) -> Error { Error::Io(err) } } impl From for Error { fn from(err: quiche::Error) -> Error { Error::Quiche(err) } } impl From for Error { fn from(err: webtransport::Error) -> Error { Error::WebTransport(err) } } // Custom server error messages. #[derive(Debug)] pub enum Server { InvalidToken, InvalidConnectionID, UnknownConnectionID, } impl From for Error { fn from(err: Server) -> Error { Error::Server(err) } } pub type Result = std::result::Result;