Skip to main content

Codec

Trait Codec 

Source
pub trait Codec: 'static {
    type ConnState: Default + 'static;

    const IS_PLAIN: bool = false;

    // Provided methods
    fn is_active(_state: &Self::ConnState) -> bool { ... }
    fn process_inbound(_state: &mut Self::ConnState, _wire_in: &[u8]) -> usize { ... }
    fn take_plaintext(_state: &mut Self::ConnState) -> Vec<u8>  { ... }
    fn install_plaintext(_state: &mut Self::ConnState, _plaintext: Vec<u8>) { ... }
    fn process_outbound(_state: &mut Self::ConnState, _plaintext_in: &[u8]) { ... }
    fn wire_slice(_state: &Self::ConnState) -> &[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 close_pending(_state: &Self::ConnState) -> bool { ... }
}

Provided Associated Constants§

Source

const IS_PLAIN: bool = false

Required Associated Types§

Source

type ConnState: Default + 'static

Provided Methods§

Source

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

Source

fn process_inbound(_state: &mut Self::ConnState, _wire_in: &[u8]) -> usize

Source

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

Source

fn install_plaintext(_state: &mut Self::ConnState, _plaintext: Vec<u8>)

Source

fn process_outbound(_state: &mut Self::ConnState, _plaintext_in: &[u8])

Source

fn wire_slice(_state: &Self::ConnState) -> &[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 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", so this trait is not object safe.

Implementors§