Skip to main content

Record

Trait Record 

pub trait Record {
    // Required methods
    fn encode(&self, out: &mut Writer);
    fn apply(&mut self, bytes: &[u8]) -> Result<(), WireError>;
}
Expand description

A mutable hook argument, erased without changing its wire representation. Replies are decoded completely before any field is assigned.

Required Methods§

fn encode(&self, out: &mut Writer)

Writes the argument into a hook call.

fn apply(&mut self, bytes: &[u8]) -> Result<(), WireError>

Applies one complete reply, refusing malformed or trailing bytes atomically.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl Record for Refused

§

impl<T> Record for Fields<T>
where T: FieldSet,

§

impl<T> Record for T
where T: Wire,