Skip to main content

CodecLayer

Trait CodecLayer 

Source
pub trait CodecLayer: 'static {
    type ConnState: Default + 'static;
    type Staging: WriteBufStorage;

    const IS_PASSTHROUGH: bool;

    // Required methods
    fn is_active(state: &Self::ConnState) -> bool;
    fn process_inbound(state: &mut Self::ConnState, wire_in: &[u8]);
    fn process_outbound(state: &mut Self::ConnState, plaintext_in: &[u8]);
    fn take_plaintext(state: &mut Self::ConnState) -> Vec<u8> ;
    fn install_plaintext(state: &mut Self::ConnState, plaintext: Vec<u8>);
    fn take_inflight(state: &mut Self::ConnState) -> Option<(*const u8, u32)>;
    fn consume_inflight(state: &mut Self::ConnState, n: usize) -> bool;
    fn has_inflight(state: &Self::ConnState) -> bool;
    fn wire_slice(state: &Self::ConnState) -> &[u8] ;
    fn close_pending(state: &Self::ConnState) -> bool;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn is_active(state: &Self::ConnState) -> bool

Source

fn process_inbound(state: &mut Self::ConnState, wire_in: &[u8])

Source

fn process_outbound(state: &mut Self::ConnState, plaintext_in: &[u8])

Source

fn take_plaintext(state: &mut Self::ConnState) -> Vec<u8>

Source

fn install_plaintext(state: &mut Self::ConnState, plaintext: Vec<u8>)

Source

fn take_inflight(state: &mut Self::ConnState) -> Option<(*const u8, u32)>

Source

fn consume_inflight(state: &mut Self::ConnState, n: usize) -> bool

Source

fn has_inflight(state: &Self::ConnState) -> bool

Source

fn wire_slice(state: &Self::ConnState) -> &[u8]

Source

fn close_pending(state: &Self::ConnState) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§