pub struct Table<T>(/* private fields */);
Expand description
A table of items.
Each item has a unique identifier. Items can be deleted without changing the identifiers of other items.
Implementations§
source§impl<'data> Table<Segment<'data>>
impl<'data> Table<Segment<'data>>
sourcepub fn find_load_segment_from_offset(
&self,
offset: u64
) -> Option<&Segment<'data>>
pub fn find_load_segment_from_offset( &self, offset: u64 ) -> Option<&Segment<'data>>
Find a PT_LOAD
segment containing the given offset.
sourcepub fn add_load_segment(
&mut self,
flags: u32,
align: u64
) -> &mut Segment<'data>
pub fn add_load_segment( &mut self, flags: u32, align: u64 ) -> &mut Segment<'data>
Add a new PT_LOAD
segment to the table.
The file offset and address will be derived from the current maximum for any segment.
The address will be chosen so that p_paddr % align == p_offset % align
.
You may wish to use Builder::load_align
for the alignment.
source§impl<'data> Table<Section<'data>>
impl<'data> Table<Section<'data>>
sourcepub fn copy(&mut self, id: SectionId) -> &mut Section<'data>
pub fn copy(&mut self, id: SectionId) -> &mut Section<'data>
Add a copy of a section to the table.
This will set the file offset of the copy to zero.
Segment::append_section
can be used to assign a valid file offset and a new address.
source§impl<'data> Table<VersionFile<'data>>
impl<'data> Table<VersionFile<'data>>
sourcepub fn add(&mut self, name: ByteString<'data>) -> VersionFileId
pub fn add(&mut self, name: ByteString<'data>) -> VersionFileId
Add a new filename to the table.
Trait Implementations§
source§impl<'a, T: Item> IntoIterator for &'a Table<T>
impl<'a, T: Item> IntoIterator for &'a Table<T>
source§impl<'a, T: Item> IntoIterator for &'a mut Table<T>
impl<'a, T: Item> IntoIterator for &'a mut Table<T>
Auto Trait Implementations§
impl<T> Freeze for Table<T>
impl<T> RefUnwindSafe for Table<T>where
T: RefUnwindSafe,
impl<T> Send for Table<T>where
T: Send,
impl<T> Sync for Table<T>where
T: Sync,
impl<T> Unpin for Table<T>where
T: Unpin,
impl<T> UnwindSafe for Table<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more