1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use crate::socket::{
SocketError,
};
use serde::de::DeserializeOwned;
pub mod websocket;
/// `ProtocolParser`s are capable of parsing the input messages from a given protocol (eg WebSocket,
/// Financial Information eXchange, etc) and deserialising into an `Output`.
pub trait ProtocolParser<Output>
where
Output: DeserializeOwned,
{
type Input;
fn parse(input: Self::Input) -> Option<Result<Output, SocketError>>;
}