object::read::elf

Trait Relr

source
pub trait Relr:
    Debug
    + Pod
    + Clone {
    type Word: Into<u64>;
    type Endian: Endian;

    const COUNT: u8;

    // Required methods
    fn get(&self, endian: Self::Endian) -> Self::Word;
    fn next(
        offset: &mut Self::Word,
        bits: &mut Self::Word,
    ) -> Option<Self::Word>;
}
Expand description

A trait for generic access to elf::Relr32 and elf::Relr64.

Required Associated Constants§

source

const COUNT: u8

The number of bits in the bit mask, excluding the lowest bit.

Required Associated Types§

Required Methods§

source

fn get(&self, endian: Self::Endian) -> Self::Word

Get the relocation entry.

This value is an offset if the lowest bit is clear, or a bit mask if the lowest bit is set.

source

fn next(offset: &mut Self::Word, bits: &mut Self::Word) -> Option<Self::Word>

Return the offset corresponding to the next bit in the bit mask.

Updates the offset and bit mask. This method should be called 31 times for Relr32 and 63 times for Relr64 to iterate over all the bits.

Returns None if the bit is not set.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Endian: Endian> Relr for Relr32<Endian>

source§

const COUNT: u8 = 31u8

source§

type Word = u32

source§

type Endian = Endian

source§

impl<Endian: Endian> Relr for Relr64<Endian>

source§

const COUNT: u8 = 63u8

source§

type Word = u64

source§

type Endian = Endian