Skip to main content

ReadFixedField

Trait ReadFixedField 

pub trait ReadFixedField<F>: FieldOffset<F>
where F: TryFromSlice,
{ // Provided method fn read_fixed_field(buf: &[u8]) -> Result<F, &'static str> { ... } }
Expand description

Reads a field without deserializing the containing struct.

The buffer must start at the beginning of the encoded struct. Only the selected field is deserialized; preceding and following fields are not validated. The offset must identify a representation readable by F.

Provided Methods§

fn read_fixed_field(buf: &[u8]) -> Result<F, &'static str>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl<T, F> ReadFixedField<F> for T
where T: FieldOffset<F>, F: TryFromSlice,