pub struct DataDirectories<'data> { /* private fields */ }
Expand description
The table of data directories in a PE file.
Implementations
sourceimpl<'data> DataDirectories<'data>
impl<'data> DataDirectories<'data>
sourcepub fn parse(data: &'data [u8], number: u32) -> Result<Self>
pub fn parse(data: &'data [u8], number: u32) -> Result<Self>
Parse the data directory table.
data
must be the remaining optional data following the
optional header. number
must be from the
number_of_rva_and_sizes
field of the optional header.
sourcepub fn iter(&self) -> Iter<'data, ImageDataDirectory>
pub fn iter(&self) -> Iter<'data, ImageDataDirectory>
Iterator over the data directories.
sourcepub fn enumerate(&self) -> Enumerate<Iter<'data, ImageDataDirectory>>
pub fn enumerate(&self) -> Enumerate<Iter<'data, ImageDataDirectory>>
Iterator which gives the directories as well as their index (one of the IMAGE_DIRECTORY_ENTRY_* constants).
sourcepub fn get(&self, index: usize) -> Option<&'data ImageDataDirectory>
pub fn get(&self, index: usize) -> Option<&'data ImageDataDirectory>
Returns the data directory at the given index.
Index should be one of the IMAGE_DIRECTORY_ENTRY_*
constants.
Returns None
if the index is larger than the table size,
or if the entry at the index has a zero virtual address.
sourcepub fn export_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<&'data ImageExportDirectory>>
pub fn export_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<&'data ImageExportDirectory>>
Returns the unparsed export directory.
data
must be the entire file data.
sourcepub fn export_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ExportTable<'data>>>
pub fn export_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ExportTable<'data>>>
Returns the partially parsed export directory.
data
must be the entire file data.
sourcepub fn import_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ImportTable<'data>>>
pub fn import_table<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ImportTable<'data>>>
Returns the partially parsed import directory.
data
must be the entire file data.
sourcepub fn relocation_blocks<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<RelocationBlockIterator<'data>>>
pub fn relocation_blocks<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<RelocationBlockIterator<'data>>>
Returns the blocks in the base relocation directory.
data
must be the entire file data.
sourcepub fn resource_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ResourceDirectory<'data>>>
pub fn resource_directory<R: ReadRef<'data>>(
&self,
data: R,
sections: &SectionTable<'data>
) -> Result<Option<ResourceDirectory<'data>>>
Returns the resource directory.
data
must be the entire file data.
Trait Implementations
sourceimpl<'data> Clone for DataDirectories<'data>
impl<'data> Clone for DataDirectories<'data>
sourcefn clone(&self) -> DataDirectories<'data>
fn clone(&self) -> DataDirectories<'data>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'data> Debug for DataDirectories<'data>
impl<'data> Debug for DataDirectories<'data>
impl<'data> Copy for DataDirectories<'data>
Auto Trait Implementations
impl<'data> RefUnwindSafe for DataDirectories<'data>
impl<'data> Send for DataDirectories<'data>
impl<'data> Sync for DataDirectories<'data>
impl<'data> Unpin for DataDirectories<'data>
impl<'data> UnwindSafe for DataDirectories<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more