wireframe 0.3.0

Simplify building servers and clients for custom binary protocols.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Test protocol that appends a terminator frame at end-of-stream.
//!
//! Used across integration and behavioural tests verifying the stream
//! termination mechanism.
use wireframe::hooks::{ConnectionContext, WireframeProtocol};

/// Protocol that produces `0` as an explicit end-of-stream marker.
pub struct Terminator;

impl WireframeProtocol for Terminator {
    type Frame = u8;
    type ProtocolError = ();

    fn stream_end_frame(&self, _ctx: &mut ConnectionContext) -> Option<Self::Frame> { Some(0) }
}