ElfWrite

Trait ElfWrite 

Source
pub trait ElfWrite {
Show 13 methods // Required method fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>; // Provided methods fn write_u8(&mut self, value: u8) -> Result<(), Error> { ... } fn write_i8(&mut self, value: i8) -> Result<(), Error> { ... } fn write_u16( &mut self, byte_order: ByteOrder, value: u16, ) -> Result<(), Error> { ... } fn write_u32( &mut self, byte_order: ByteOrder, value: u32, ) -> Result<(), Error> { ... } fn write_u64( &mut self, byte_order: ByteOrder, value: u64, ) -> Result<(), Error> { ... } fn write_i16( &mut self, byte_order: ByteOrder, value: i16, ) -> Result<(), Error> { ... } fn write_i32( &mut self, byte_order: ByteOrder, value: i32, ) -> Result<(), Error> { ... } fn write_i64( &mut self, byte_order: ByteOrder, value: i64, ) -> Result<(), Error> { ... } fn write_word( &mut self, class: Class, byte_order: ByteOrder, value: u64, ) -> Result<(), Error> { ... } fn write_word_as_u32( &mut self, class: Class, byte_order: ByteOrder, value: u32, ) -> Result<(), Error> { ... } fn write_u32_as_u64( &mut self, byte_order: ByteOrder, value: u64, ) -> Result<(), Error> { ... } fn write_i32_as_i64( &mut self, byte_order: ByteOrder, value: i64, ) -> Result<(), Error> { ... }
}
Expand description

ELF-specific write functions.

Required Methods§

Source

fn write_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>

Write all bytes.

Similar to Write::write_all.

Provided Methods§

Source

fn write_u8(&mut self, value: u8) -> Result<(), Error>

Write one byte as u8.

Source

fn write_i8(&mut self, value: i8) -> Result<(), Error>

Write one byte as i8.

Source

fn write_u16(&mut self, byte_order: ByteOrder, value: u16) -> Result<(), Error>

Write u16.

Source

fn write_u32(&mut self, byte_order: ByteOrder, value: u32) -> Result<(), Error>

Write u32.

Source

fn write_u64(&mut self, byte_order: ByteOrder, value: u64) -> Result<(), Error>

Write u64.

Source

fn write_i16(&mut self, byte_order: ByteOrder, value: i16) -> Result<(), Error>

Write i16.

Source

fn write_i32(&mut self, byte_order: ByteOrder, value: i32) -> Result<(), Error>

Write i32.

Source

fn write_i64(&mut self, byte_order: ByteOrder, value: i64) -> Result<(), Error>

Write i64.

Source

fn write_word( &mut self, class: Class, byte_order: ByteOrder, value: u64, ) -> Result<(), Error>

Write one word.

Writes u32 when the class is Class::Elf32, writes u64 otherwise.

Source

fn write_word_as_u32( &mut self, class: Class, byte_order: ByteOrder, value: u32, ) -> Result<(), Error>

Write a word specified by value.

Source

fn write_u32_as_u64( &mut self, byte_order: ByteOrder, value: u64, ) -> Result<(), Error>

Write value as u64.

Source

fn write_i32_as_i64( &mut self, byte_order: ByteOrder, value: i64, ) -> Result<(), Error>

Write value as i32.

Implementors§

Source§

impl<W: Write + ?Sized> ElfWrite for W

Available on crate feature std only.