Trait object::read::macho::Section [−][src]
pub trait Section: Debug + Pod { type Word: Into<u64>; type Endian: Endian;}Show methods
fn sectname(&self) -> &[u8; 16]; fn segname(&self) -> &[u8; 16]; fn addr(&self, endian: Self::Endian) -> Self::Word; fn size(&self, endian: Self::Endian) -> Self::Word; fn offset(&self, endian: Self::Endian) -> u32; fn align(&self, endian: Self::Endian) -> u32; fn reloff(&self, endian: Self::Endian) -> u32; fn nreloc(&self, endian: Self::Endian) -> u32; fn flags(&self, endian: Self::Endian) -> u32; fn name(&self) -> &[u8] { ... } fn segment_name(&self) -> &[u8] { ... } fn file_range(&self, endian: Self::Endian) -> Option<(u64, u64)> { ... } fn data<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [u8], ()> { ... } fn relocations<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [Relocation<Self::Endian>]> { ... }
Expand description
A trait for generic access to Section32
and Section64
.
Associated Types
Required methods
fn sectname(&self) -> &[u8; 16]
[src]
fn segname(&self) -> &[u8; 16]
[src]
fn addr(&self, endian: Self::Endian) -> Self::Word
[src]
fn size(&self, endian: Self::Endian) -> Self::Word
[src]
fn offset(&self, endian: Self::Endian) -> u32
[src]
fn align(&self, endian: Self::Endian) -> u32
[src]
fn reloff(&self, endian: Self::Endian) -> u32
[src]
fn nreloc(&self, endian: Self::Endian) -> u32
[src]
fn flags(&self, endian: Self::Endian) -> u32
[src]
Provided methods
fn segment_name(&self) -> &[u8]
[src]
fn segment_name(&self) -> &[u8]
[src]Return the segname
bytes up until the null terminator.
fn file_range(&self, endian: Self::Endian) -> Option<(u64, u64)>
[src]
fn file_range(&self, endian: Self::Endian) -> Option<(u64, u64)>
[src]Return the offset and size of the section in the file.
Returns None
for sections that have no data in the file.
fn data<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [u8], ()>
[src]
fn data<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [u8], ()>
[src]Return the section data.
Returns Ok(&[])
if the section has no data.
Returns Err
for invalid values.
fn relocations<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [Relocation<Self::Endian>]>
[src]
fn relocations<'data, R: ReadRef<'data>>(
&self,
endian: Self::Endian,
data: R
) -> Result<&'data [Relocation<Self::Endian>]>
[src]Return the relocation array.
Returns Err
for invalid values.
Implementors
impl<Endian: Endian> Section for Section32<Endian>
[src]
impl<Endian: Endian> Section for Section32<Endian>
[src]type Word = u32
type Endian = Endian
fn sectname(&self) -> &[u8; 16]
[src]
fn segname(&self) -> &[u8; 16]
[src]
fn addr(&self, endian: Self::Endian) -> Self::Word
[src]
fn size(&self, endian: Self::Endian) -> Self::Word
[src]
fn offset(&self, endian: Self::Endian) -> u32
[src]
fn align(&self, endian: Self::Endian) -> u32
[src]
fn reloff(&self, endian: Self::Endian) -> u32
[src]
fn nreloc(&self, endian: Self::Endian) -> u32
[src]
fn flags(&self, endian: Self::Endian) -> u32
[src]
impl<Endian: Endian> Section for Section64<Endian>
[src]
impl<Endian: Endian> Section for Section64<Endian>
[src]