cuprate_epee_encoding

Trait 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.

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§