edlang/object/index.html
2024-02-13 06:38:44 +00:00

28 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="`object`"><title>object - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="object" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../object/index.html">object</a><span class="version">0.32.2</span></h2></div><div class="sidebar-elems"><ul class="block">
<li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#enums">Enums</a></li></ul></section></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../object/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">object</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/object/lib.rs.html#1-99">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="object"><a href="#object"><code>object</code></a></h2>
<p>The <code>object</code> crate provides a unified interface to working with object files
across platforms. It supports reading relocatable object files and executable files,
and writing relocatable object files and some executable files.</p>
<h3 id="raw-struct-definitions"><a href="#raw-struct-definitions">Raw struct definitions</a></h3>
<p>Raw structs are defined for: <a href="elf/index.html" title="mod object::elf">ELF</a>, <a href="macho/index.html" title="mod object::macho">Mach-O</a>, <a href="pe/index.html" title="mod object::pe">PE/COFF</a>,
<a href="xcoff">XCOFF</a>, <a href="archive/index.html" title="mod object::archive">archive</a>.
Types and traits for zerocopy support are defined in the <a href="pod/index.html" title="mod object::pod"><code>pod</code></a> and <a href="endian/index.html" title="mod object::endian"><code>endian</code></a> modules.</p>
<h3 id="unified-read-api"><a href="#unified-read-api">Unified read API</a></h3>
<p>The <a href="read/index.html" title="mod object::read"><code>read</code></a> module provides a unified read API using the <a href="read/trait.Object.html" title="trait object::read::Object"><code>read::Object</code></a> trait.
There is an implementation of this trait for <a href="read/enum.File.html" title="enum object::read::File"><code>read::File</code></a>, which allows reading any
file format, as well as implementations for each file format.</p>
<h3 id="low-level-read-api"><a href="#low-level-read-api">Low level read API</a></h3>
<p>The <a href="read/index.html#modules" title="mod object::read"><code>read</code></a> submodules define helpers that operate on the raw structs.
These can be used instead of the unified API, or in conjunction with it to access
details that are not available via the unified API.</p>
<h3 id="unified-write-api"><a href="#unified-write-api">Unified write API</a></h3>
<p>The [<code>mod@write</code>] module provides a unified write API for relocatable object files
using [<code>write::Object</code>]. This does not support writing executable files.</p>
<h3 id="low-level-write-api"><a href="#low-level-write-api">Low level write API</a></h3>
<p>The [<code>mod@write#modules</code>] submodules define helpers for writing the raw structs.</p>
<h3 id="shared-definitions"><a href="#shared-definitions">Shared definitions</a></h3>
<p>The crate provides a number of definitions that are used by both the read and write
APIs. These are defined at the top level module, but none of these are the main entry
points of the crate.</p>
</div></details><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2><ul class="item-table"><li><div class="item-name"><code>pub use <a class="mod" href="endian/index.html" title="mod object::endian">endian</a>::*;</code></div></li><li><div class="item-name"><code>pub use <a class="mod" href="pod/index.html" title="mod object::pod">pod</a>::*;</code></div></li><li><div class="item-name"><code>pub use <a class="mod" href="read/index.html" title="mod object::read">read</a>::*;</code></div></li></ul><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="archive/index.html" title="mod object::archive">archive</a></div><div class="desc docblock-short">Archive definitions.</div></li><li><div class="item-name"><a class="mod" href="elf/index.html" title="mod object::elf">elf</a></div><div class="desc docblock-short">ELF definitions.</div></li><li><div class="item-name"><a class="mod" href="endian/index.html" title="mod object::endian">endian</a></div><div class="desc docblock-short">Types for compile-time and run-time endianness.</div></li><li><div class="item-name"><a class="mod" href="macho/index.html" title="mod object::macho">macho</a></div><div class="desc docblock-short">Mach-O definitions.</div></li><li><div class="item-name"><a class="mod" href="pe/index.html" title="mod object::pe">pe</a></div><div class="desc docblock-short">PE/COFF definitions.</div></li><li><div class="item-name"><a class="mod" href="pod/index.html" title="mod object::pod">pod</a></div><div class="desc docblock-short">Tools for converting file format structures to and from bytes.</div></li><li><div class="item-name"><a class="mod" href="read/index.html" title="mod object::read">read</a></div><div class="desc docblock-short">Interface for reading object files.</div></li></ul><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.AddressSize.html" title="enum object::AddressSize">AddressSize</a></div><div class="desc docblock-short">The size of an address value for an architecture.</div></li><li><div class="item-name"><a class="enum" href="enum.Architecture.html" title="enum object::Architecture">Architecture</a></div><div class="desc docblock-short">A CPU architecture.</div></li><li><div class="item-name"><a class="enum" href="enum.BinaryFormat.html" title="enum object::BinaryFormat">BinaryFormat</a></div><div class="desc docblock-short">A binary file format.</div></li><li><div class="item-name"><a class="enum" href="enum.ComdatKind.html" title="enum object::ComdatKind">ComdatKind</a></div><div class="desc docblock-short">The selection kind for a COMDAT section group.</div></li><li><div class="item-name"><a class="enum" href="enum.FileFlags.html" title="enum object::FileFlags">FileFlags</a></div><div class="desc docblock-short">File flags that are specific to each file format.</div></li><li><div class="item-name"><a class="enum" href="enum.RelocationEncoding.html" title="enum object::RelocationEncoding">RelocationEncoding</a></div><div class="desc docblock-short">Information about how the result of the relocation operation is encoded in the place.</div></li><li><div class="item-name"><a class="enum" href="enum.RelocationKind.html" title="enum object::RelocationKind">RelocationKind</a></div><div class="desc docblock-short">The operation used to calculate the result of the relocation.</div></li><li><div class="item-name"><a class="enum" href="enum.SectionFlags.html" title="enum object::SectionFlags">SectionFlags</a></div><div class="desc docblock-short">Section flags that are specific to each file format.</div></li><li><div class="item-name"><a class="enum" href="enum.SectionKind.html" title="enum object::SectionKind">SectionKind</a></div><div class="desc docblock-short">The kind of a section.</div></li><li><div class="item-name"><a class="enum" href="enum.SegmentFlags.html" title="enum object::SegmentFlags">SegmentFlags</a></div><div class="desc docblock-short">Segment flags that are specific to each file format.</div></li><li><div class="item-name"><a class="enum" href="enum.SubArchitecture.html" title="enum object::SubArchitecture">SubArchitecture</a></div><div class="desc docblock-short">A CPU sub-architecture.</div></li><li><div class="item-name"><a class="enum" href="enum.SymbolFlags.html" title="enum object::SymbolFlags">SymbolFlags</a></div><div class="desc docblock-short">Symbol flags that are specific to each file format.</div></li><li><div class="item-name"><a class="enum" href="enum.SymbolKind.html" title="enum object::SymbolKind">SymbolKind</a></div><div class="desc docblock-short">The kind of a symbol.</div></li><li><div class="item-name"><a class="enum" href="enum.SymbolScope.html" title="enum object::SymbolScope">SymbolScope</a></div><div class="desc docblock-short">A symbol scope.</div></li></ul></section></div></main></body></html>