webparse 0.3.1

http1.1/http2 parse http解析库
Documentation
use crate::WebError;



#[derive(Debug)]
pub enum WsError {
    DataFrameError(&'static str),
    ProtocolError(&'static str),
    NoDataAvailable,
}

impl WsError {
    #[inline]
    pub fn description_str(&self) -> &'static str {
        match *self {
            Self::DataFrameError(s) => s,
            _ => "",
        }
    }

    pub fn into<E: Into<WsError>>(e: E) -> WebError {
        WebError::Ws(e.into())
    }
}

impl Into<WebError> for WsError {
    fn into(self) -> WebError {
        WebError::Ws(self)
    }
}