gimli::read::reader

Trait ReaderAddress

Source
pub(crate) trait ReaderAddress: Sized {
    // Required methods
    fn add_sized(self, length: u64, size: u8) -> Result<Self>;
    fn wrapping_add_sized(self, length: u64, size: u8) -> Self;
    fn ones_sized(size: u8) -> Self;
}
Expand description

A trait for addresses within a DWARF section.

Currently this is a simple extension trait for u64, but it may be expanded in the future to support user-defined address types.

Required Methods§

Source

fn add_sized(self, length: u64, size: u8) -> Result<Self>

Add a length to an address of the given size.

Returns an error for overflow.

Source

fn wrapping_add_sized(self, length: u64, size: u8) -> Self

Add a length to an address of the given size.

Wraps the result to the size of the address to allow for the possibility that the length is a negative value.

Source

fn ones_sized(size: u8) -> Self

The all-ones value of an address of the given size.

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.

Implementations on Foreign Types§

Source§

impl ReaderAddress for u64

Source§

fn add_sized(self, length: u64, size: u8) -> Result<Self>

Source§

fn wrapping_add_sized(self, length: u64, size: u8) -> Self

Source§

fn ones_sized(size: u8) -> Self

Implementors§