1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)
    }
}