Struct object::read::macho::MachOSegment
source · pub struct MachOSegment<'data, 'file, Mach, R = &'data [u8]>where
Mach: MachHeader,
R: ReadRef<'data>,{
file: &'file MachOFile<'data, Mach, R>,
internal: &'file MachOSegmentInternal<'data, Mach, R>,
}
Expand description
A segment in a MachOFile
.
Most functionality is provided by the ObjectSegment
trait implementation.
Fields§
§file: &'file MachOFile<'data, Mach, R>
§internal: &'file MachOSegmentInternal<'data, Mach, R>
Implementations§
source§impl<'data, 'file, Mach, R> MachOSegment<'data, 'file, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
impl<'data, 'file, Mach, R> MachOSegment<'data, 'file, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
sourcepub fn macho_file(&self) -> &'file MachOFile<'data, Mach, R>
pub fn macho_file(&self) -> &'file MachOFile<'data, Mach, R>
Get the Mach-O file containing this segment.
sourcepub fn macho_segment(&self) -> &'data Mach::Segment
pub fn macho_segment(&self) -> &'data Mach::Segment
Get the raw Mach-O segment structure.
fn bytes(&self) -> Result<&'data [u8]>
Trait Implementations§
source§impl<'data, 'file, Mach, R> Debug for MachOSegment<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> Debug for MachOSegment<'data, 'file, Mach, R>
source§impl<'data, 'file, Mach, R> ObjectSegment<'data> for MachOSegment<'data, 'file, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
impl<'data, 'file, Mach, R> ObjectSegment<'data> for MachOSegment<'data, 'file, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
source§fn file_range(&self) -> (u64, u64)
fn file_range(&self) -> (u64, u64)
Returns the offset and size of the segment in the file.
source§fn data(&self) -> Result<&'data [u8]>
fn data(&self) -> Result<&'data [u8]>
Returns a reference to the file contents of the segment. Read more
source§fn data_range(&self, address: u64, size: u64) -> Result<Option<&'data [u8]>>
fn data_range(&self, address: u64, size: u64) -> Result<Option<&'data [u8]>>
Return the segment data in the given range. Read more
source§fn flags(&self) -> SegmentFlags
fn flags(&self) -> SegmentFlags
Return the flags of segment.
impl<'data, 'file, Mach, R> Sealed for MachOSegment<'data, 'file, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
Auto Trait Implementations§
impl<'data, 'file, Mach, R> Freeze for MachOSegment<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> RefUnwindSafe for MachOSegment<'data, 'file, Mach, R>where
<Mach as MachHeader>::Endian: RefUnwindSafe,
R: RefUnwindSafe,
Mach: RefUnwindSafe,
<Mach as MachHeader>::Segment: RefUnwindSafe,
<Mach as MachHeader>::Nlist: RefUnwindSafe,
<Mach as MachHeader>::Section: RefUnwindSafe,
impl<'data, 'file, Mach, R> Send for MachOSegment<'data, 'file, Mach, R>where
<Mach as MachHeader>::Endian: Sync,
R: Sync,
Mach: Sync,
<Mach as MachHeader>::Segment: Sync,
<Mach as MachHeader>::Nlist: Sync,
<Mach as MachHeader>::Section: Sync,
impl<'data, 'file, Mach, R> Sync for MachOSegment<'data, 'file, Mach, R>where
<Mach as MachHeader>::Endian: Sync,
R: Sync,
Mach: Sync,
<Mach as MachHeader>::Segment: Sync,
<Mach as MachHeader>::Nlist: Sync,
<Mach as MachHeader>::Section: Sync,
impl<'data, 'file, Mach, R> Unpin for MachOSegment<'data, 'file, Mach, R>
impl<'data, 'file, Mach, R> UnwindSafe for MachOSegment<'data, 'file, Mach, R>where
<Mach as MachHeader>::Endian: RefUnwindSafe,
R: RefUnwindSafe,
Mach: RefUnwindSafe,
<Mach as MachHeader>::Segment: RefUnwindSafe,
<Mach as MachHeader>::Nlist: RefUnwindSafe,
<Mach as MachHeader>::Section: RefUnwindSafe,
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