Struct gimli::write::EndianVec

source ·
pub struct EndianVec<Endian>
where Endian: Endianity,
{ /* private fields */ }
Expand description

A Vec<u8> with endianity metadata.

This implements the Writer trait, which is used for all writing of DWARF sections.

Implementations§

source§

impl<Endian> EndianVec<Endian>
where Endian: Endianity,

source

pub fn new(endian: Endian) -> EndianVec<Endian>

Construct an empty EndianVec with the given endianity.

source

pub fn slice(&self) -> &[u8]

Return a reference to the raw slice.

source

pub fn into_vec(self) -> Vec<u8>

Convert into a Vec<u8>.

source

pub fn take(&mut self) -> Vec<u8>

Take any written data out of the EndianVec, leaving an empty Vec in its place.

Trait Implementations§

source§

impl<Endian> Clone for EndianVec<Endian>
where Endian: Endianity + Clone,

source§

fn clone(&self) -> EndianVec<Endian>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Endian> Debug for EndianVec<Endian>
where Endian: Endianity + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Endian> Writer for EndianVec<Endian>
where Endian: Endianity,

source§

type Endian = Endian

The endianity of bytes that are written.
source§

fn endian(&self) -> Self::Endian

Return the endianity of bytes that are written.
source§

fn len(&self) -> usize

Return the current section length. Read more
source§

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

Write a slice.
source§

fn write_at(&mut self, offset: usize, bytes: &[u8]) -> Result<()>

Write a slice at a given offset. Read more
source§

fn write_address(&mut self, address: Address, size: u8) -> Result<()>

Write an address. Read more
source§

fn write_eh_pointer( &mut self, address: Address, eh_pe: DwEhPe, size: u8, ) -> Result<()>

Write an address with a .eh_frame pointer encoding. Read more
source§

fn write_eh_pointer_data( &mut self, val: u64, format: DwEhPe, size: u8, ) -> Result<()>

Write a value with a .eh_frame pointer format. Read more
source§

fn write_offset( &mut self, val: usize, _section: SectionId, size: u8, ) -> Result<()>

Write an offset that is relative to the start of the given section. Read more
source§

fn write_offset_at( &mut self, offset: usize, val: usize, _section: SectionId, size: u8, ) -> Result<()>

Write an offset that is relative to the start of the given section. Read more
source§

fn write_reference(&mut self, _symbol: usize, _size: u8) -> Result<()>

Write a reference to a symbol. Read more
source§

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

Write a u8.
source§

fn write_u16(&mut self, val: u16) -> Result<()>

Write a u16.
source§

fn write_u32(&mut self, val: u32) -> Result<()>

Write a u32.
source§

fn write_u64(&mut self, val: u64) -> Result<()>

Write a u64.
source§

fn write_u8_at(&mut self, offset: usize, val: u8) -> Result<()>

Write a u8 at the given offset.
source§

fn write_u16_at(&mut self, offset: usize, val: u16) -> Result<()>

Write a u16 at the given offset.
source§

fn write_u32_at(&mut self, offset: usize, val: u32) -> Result<()>

Write a u32 at the given offset.
source§

fn write_u64_at(&mut self, offset: usize, val: u64) -> Result<()>

Write a u64 at the given offset.
source§

fn write_udata(&mut self, val: u64, size: u8) -> Result<()>

Write unsigned data of the given size. Read more
source§

fn write_sdata(&mut self, val: i64, size: u8) -> Result<()>

Write signed data of the given size. Read more
source§

fn write_udata_at(&mut self, offset: usize, val: u64, size: u8) -> Result<()>

Write a word of the given size at the given offset. Read more
source§

fn write_uleb128(&mut self, val: u64) -> Result<()>

Write an unsigned LEB128 encoded integer.
source§

fn write_sleb128(&mut self, val: i64) -> Result<()>

Read an unsigned LEB128 encoded integer.
source§

fn write_initial_length( &mut self, format: Format, ) -> Result<InitialLengthOffset>

Write an initial length according to the given DWARF format. Read more
source§

fn write_initial_length_at( &mut self, offset: InitialLengthOffset, length: u64, format: Format, ) -> Result<()>

Write an initial length at the given offset according to the given DWARF format. Read more

Auto Trait Implementations§

§

impl<Endian> Freeze for EndianVec<Endian>
where Endian: Freeze,

§

impl<Endian> RefUnwindSafe for EndianVec<Endian>
where Endian: RefUnwindSafe,

§

impl<Endian> Send for EndianVec<Endian>
where Endian: Send,

§

impl<Endian> Sync for EndianVec<Endian>
where Endian: Sync,

§

impl<Endian> Unpin for EndianVec<Endian>
where Endian: Unpin,

§

impl<Endian> UnwindSafe for EndianVec<Endian>
where Endian: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.