pub enum AnyEndian {
Little,
Big,
}
Expand description
An endian parsing type that can choose at runtime which byte order to parse integers as. This is useful for scenarios where a single compiled binary wants to dynamically interpret ELF files of any byte order.
Variants§
Little
Used for a little-endian ELF structures that have been parsed with AnyEndian
Big
Used for a big-endian ELF structures that have been parsed with AnyEndian
Trait Implementations§
source§impl EndianParse for AnyEndian
impl EndianParse for AnyEndian
source§fn from_ei_data(ei_data: u8) -> Result<Self, ParseError>
fn from_ei_data(ei_data: u8) -> Result<Self, ParseError>
fn is_little(self) -> bool
fn parse_u8_at(self, offset: &mut usize, data: &[u8]) -> Result<u8, ParseError>
fn parse_u16_at( self, offset: &mut usize, data: &[u8] ) -> Result<u16, ParseError>
fn parse_u32_at( self, offset: &mut usize, data: &[u8] ) -> Result<u32, ParseError>
fn parse_u64_at( self, offset: &mut usize, data: &[u8] ) -> Result<u64, ParseError>
fn parse_i32_at( self, offset: &mut usize, data: &[u8] ) -> Result<i32, ParseError>
fn parse_i64_at( self, offset: &mut usize, data: &[u8] ) -> Result<i64, ParseError>
fn is_big(self) -> bool
source§impl PartialEq for AnyEndian
impl PartialEq for AnyEndian
impl Copy for AnyEndian
impl Eq for AnyEndian
impl StructuralEq for AnyEndian
impl StructuralPartialEq for AnyEndian
Auto Trait Implementations§
impl RefUnwindSafe for AnyEndian
impl Send for AnyEndian
impl Sync for AnyEndian
impl Unpin for AnyEndian
impl UnwindSafe for AnyEndian
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more