pub struct BinFile {
path: PathBuf,
data: Vec<u8>,
}Expand description
Thin wrapper for owning data used by object, which may be either an archive or a single
object file.
Fields§
§path: PathBuf§data: Vec<u8>Implementations§
Source§impl BinFile
impl BinFile
Sourcepub fn parse_as_archive_file(&self) -> ObjResult<ArchiveFile<'_>>
pub fn parse_as_archive_file(&self) -> ObjResult<ArchiveFile<'_>>
Access the owned buffer as an archive file.
Sourcepub fn parse_as_obj_file(&self) -> ObjResult<ObjFile<'_>>
pub fn parse_as_obj_file(&self) -> ObjResult<ObjFile<'_>>
Access the owned buffer as an archive file.
Sourcepub fn for_each_object(&self, f: impl FnMut(ObjFile<'_>, &BStr))
pub fn for_each_object(&self, f: impl FnMut(ObjFile<'_>, &BStr))
If the file is an archive, run the callback for each object file. If it is an object file, the callback will run once.
The callback receives the parsed object file and its name in the archive or on disk.
Sourcepub fn for_each_symbol(
&self,
f: impl FnMut(Symbol<'_, '_>, &ObjFile<'_>, &BStr),
)
pub fn for_each_symbol( &self, f: impl FnMut(Symbol<'_, '_>, &ObjFile<'_>, &BStr), )
Do something with each symbol in an archive or object file.
The callback receives:
- The symbol.
- The parsed object file that contains the symbol.
- The name of the object file in its archive or on disk.
Auto Trait Implementations§
impl Forget for BinFile
impl Freeze for BinFile
impl RefUnwindSafe for BinFile
impl Send for BinFile
impl Sync for BinFile
impl Unpin for BinFile
impl UnsafeUnpin for BinFile
impl UnwindSafe for BinFile
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes