Trait ext4_read_only::structs::ParseToStruct
source · pub trait ParseToStruct: FromBytes + NoCell + 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§
fn from_reader_with_offset( reader: &dyn Reader, offset: u64 ) -> Result<Self, ParsingError>
sourcefn to_struct_ref(
data: &[u8],
error_type: ParsingError
) -> Result<&Self, ParsingError>
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
.
Object Safety§
This trait is not object safe.
Implementors§
impl<T: FromBytes + NoCell + Unaligned> ParseToStruct for T
Apply to all EXT4 structs as seen above.