Trait cuprate_epee_encoding::EpeeObjectBuilder

source ·
pub trait EpeeObjectBuilder<T>: Default + Sized {
    // Required methods
    fn add_field<B: Buf>(&mut self, name: &str, b: &mut B) -> Result<bool>;
    fn finish(self) -> Result<T>;
}
Expand description

A trait for an object that can build a type T from the epee format.

Required Methods§

source

fn add_field<B: Buf>(&mut self, name: &str, b: &mut B) -> Result<bool>

Called when a field names has been read no other bytes following the field name will have been read.

Returns a bool if true then the field has been read otherwise the field is not needed and has not been read.

source

fn finish(self) -> Result<T>

Called when the number of fields has been read.

Object Safety§

This trait is not object safe.

Implementors§