gremlin-client 0.8.10

A Rust client for Apache TinkerPop™
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::GremlinError;
use async_tungstenite::tungstenite;

impl From<&tungstenite::error::Error> for GremlinError {
    fn from(e: &tungstenite::error::Error) -> GremlinError {
        let error = match e {
            tungstenite::error::Error::AlreadyClosed => tungstenite::error::Error::AlreadyClosed,
            tungstenite::error::Error::ConnectionClosed => {
                tungstenite::error::Error::ConnectionClosed
            }
            _ => return GremlinError::Generic(format!("Error from ws {}", e)),
        };
        GremlinError::WebSocketAsync(error)
    }
}