ext4_read_only::structs

Trait ParseToStruct

Source
pub trait ParseToStruct:
    FromBytes
    + KnownLayout
    + Immutable
    + Unaligned
    + Sized {
    // Provided methods
    fn from_reader_with_offset(
        reader: &dyn Reader,
        offset: u64,
    ) -> Result<Self, ParsingError> { ... }
    fn to_struct_ref(
        data: &[u8],
        error_type: ParsingError,
    ) -> Result<&Self, ParsingError> { ... }
}
Expand description

All functions to help parse data into respective structs.

Provided Methods§

Source

fn from_reader_with_offset( reader: &dyn Reader, offset: u64, ) -> Result<Self, ParsingError>

Source

fn to_struct_ref( data: &[u8], error_type: ParsingError, ) -> Result<&Self, ParsingError>

Casts the &u8 data to &Self.

Self is the ext4 struct that represents the given data.

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§

Source§

impl<T: FromBytes + KnownLayout + Immutable + Unaligned> ParseToStruct for T

Apply to all EXT4 structs as seen above.