Trait StreamParser

Source
pub trait StreamParser {
    type Stream: Stream;
    type Message;
    type Error;

    // Required method
    fn parse<Output>(
        input: Result<Self::Message, Self::Error>,
    ) -> Option<Result<Output, SocketError>>
       where Output: DeserializeOwned;
}
Expand description

StreamParsers are capable of parsing the input messages from a given stream protocol (eg/ WebSocket, Financial Information eXchange (FIX), etc.) and deserialising into an Output.

Required Associated Types§

Required Methods§

Source

fn parse<Output>( input: Result<Self::Message, Self::Error>, ) -> Option<Result<Output, SocketError>>
where Output: DeserializeOwned,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§