Skip to main content

FieldDecoder

Trait FieldDecoder 

Source
pub trait FieldDecoder: Sized {
    type Buffer: AsMut<[u8]> + Default;

    // Required method
    fn decode(bytes: &[u8]) -> Result<Self, Error>;
}
Expand description

Decodes a fixed-format XRPL field from its raw byte representation.

Required Associated Types§

Source

type Buffer: AsMut<[u8]> + Default

A stack buffer sized to hold this field’s raw bytes, used by generic host-field getters to read into before calling decode.

Required Methods§

Source

fn decode(bytes: &[u8]) -> Result<Self, Error>

Decodes Self from bytes, returning an error if the bytes are malformed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§