mirror of
https://github.com/Rust-GPU/rust-gpu.git
synced 2026-06-08 02:29:51 +09:00
87 lines
44 KiB
HTML
87 lines
44 KiB
HTML
<!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="A helper for writing COFF files."><title>Writer in object::write::coff - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.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.96.0-nightly (02c7f9bec 2026-04-10)" data-channel="nightly" data-search-js="search-b5634cc7.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc struct"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Writer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../object/index.html">object</a><span class="version">0.37.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Writer</a></h2><h3><a href="#implementations">Associated Functions</a></h3><ul class="block method"><li><a href="#method.new" title="new">new</a></li></ul><h3><a href="#implementations">Methods</a></h3><ul class="block method"><li><a href="#method.add_name" title="add_name">add_name</a></li><li><a href="#method.add_string" title="add_string">add_string</a></li><li><a href="#method.len" title="len">len</a></li><li><a href="#method.pad_until" title="pad_until">pad_until</a></li><li><a href="#method.reserve" title="reserve">reserve</a></li><li><a href="#method.reserve_aux_file_name" title="reserve_aux_file_name">reserve_aux_file_name</a></li><li><a href="#method.reserve_aux_section" title="reserve_aux_section">reserve_aux_section</a></li><li><a href="#method.reserve_aux_weak_external" title="reserve_aux_weak_external">reserve_aux_weak_external</a></li><li><a href="#method.reserve_file_header" title="reserve_file_header">reserve_file_header</a></li><li><a href="#method.reserve_relocations" title="reserve_relocations">reserve_relocations</a></li><li><a href="#method.reserve_section" title="reserve_section">reserve_section</a></li><li><a href="#method.reserve_section_headers" title="reserve_section_headers">reserve_section_headers</a></li><li><a href="#method.reserve_symbol_index" title="reserve_symbol_index">reserve_symbol_index</a></li><li><a href="#method.reserve_symbol_indices" title="reserve_symbol_indices">reserve_symbol_indices</a></li><li><a href="#method.reserve_symtab_strtab" title="reserve_symtab_strtab">reserve_symtab_strtab</a></li><li><a href="#method.reserve_until" title="reserve_until">reserve_until</a></li><li><a href="#method.reserved_len" title="reserved_len">reserved_len</a></li><li><a href="#method.symbol_count" title="symbol_count">symbol_count</a></li><li><a href="#method.write" title="write">write</a></li><li><a href="#method.write_align" title="write_align">write_align</a></li><li><a href="#method.write_aux_file_name" title="write_aux_file_name">write_aux_file_name</a></li><li><a href="#method.write_aux_section" title="write_aux_section">write_aux_section</a></li><li><a href="#method.write_aux_weak_external" title="write_aux_weak_external">write_aux_weak_external</a></li><li><a href="#method.write_file_header" title="write_file_header">write_file_header</a></li><li><a href="#method.write_relocation" title="write_relocation">write_relocation</a></li><li><a href="#method.write_relocations_count" title="write_relocations_count">write_relocations_count</a></li><li><a href="#method.write_section" title="write_section">write_section</a></li><li><a href="#method.write_section_align" title="write_section_align">write_section_align</a></li><li><a href="#method.write_section_header" title="write_section_header">write_section_header</a></li><li><a href="#method.write_section_zeroes" title="write_section_zeroes">write_section_zeroes</a></li><li><a href="#method.write_strtab" title="write_strtab">write_strtab</a></li><li><a href="#method.write_symbol" title="write_symbol">write_symbol</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-RefUnwindSafe-for-Writer%3C'a%3E" title="!RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send-for-Writer%3C'a%3E" title="!Send">!Send</a></li><li><a href="#impl-Sync-for-Writer%3C'a%3E" title="!Sync">!Sync</a></li><li><a href="#impl-UnwindSafe-for-Writer%3C'a%3E" title="!UnwindSafe">!UnwindSafe</a></li><li><a href="#impl-Freeze-for-Writer%3C'a%3E" title="Freeze">Freeze</a></li><li><a href="#impl-Unpin-for-Writer%3C'a%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnsafeUnpin-for-Writer%3C'a%3E" title="UnsafeUnpin">UnsafeUnpin</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block blanket-implementation"><li><a href="#impl-Any-for-T" title="Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-T" title="Borrow<T>">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E-for-T" title="BorrowMut<T>">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E-for-T" title="From<T>">From<T></a></li><li><a href="#impl-Into%3CU%3E-for-T" title="Into<U>">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E-for-T" title="TryFrom<U>">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E-for-T" title="TryInto<U>">TryInto<U></a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In object::<wbr>write::<wbr>coff</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">object</a>::<wbr><a href="../index.html">write</a>::<wbr><a href="index.html">coff</a></div><h1>Struct <span class="struct">Writer</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/object/write/coff/writer.rs.html#29-42">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Writer<'a> { <span class="comment">/* private fields */</span> }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A helper for writing COFF files.</p>
|
|
<p>Writing uses a two phase approach. The first phase builds up all of the information
|
|
that may need to be known ahead of time:</p>
|
|
<ul>
|
|
<li>build string table</li>
|
|
<li>reserve section indices</li>
|
|
<li>reserve symbol indices</li>
|
|
<li>reserve file ranges for headers and sections</li>
|
|
</ul>
|
|
<p>Some of the information has ordering requirements. For example, strings must be added
|
|
to the string table before reserving the file range for the string table. There are debug
|
|
asserts to check some of these requirements.</p>
|
|
<p>The second phase writes everything out in order. Thus the caller must ensure writing
|
|
is in the same order that file ranges were reserved. There are debug asserts to assist
|
|
with checking this.</p>
|
|
</div></details><h2 id="implementations" class="section-header">Implementations<a href="#implementations" class="anchor">§</a></h2><div id="implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Writer%3C'a%3E" class="impl"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#44-462">Source</a><a href="#impl-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#46-61">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(buffer: &'a mut dyn <a class="trait" href="../trait.WritableBuffer.html" title="trait object::write::WritableBuffer">WritableBuffer</a>) -> Self</h4></section></summary><div class="docblock"><p>Create a new <code>Writer</code>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserved_len" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#64-66">Source</a><h4 class="code-header">pub fn <a href="#method.reserved_len" class="fn">reserved_len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the current file length that has been reserved.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.len" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#70-72">Source</a><h4 class="code-header">pub fn <a href="#method.len" class="fn">len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the current file length that has been written.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#79-86">Source</a><h4 class="code-header">pub fn <a href="#method.reserve" class="fn">reserve</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, align_start: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Reserve a file range with the given size and starting alignment.</p>
|
|
<p>Returns the aligned offset of the start of the range.</p>
|
|
<p><code>align_start</code> must be a power of two.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_align" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#89-93">Source</a><h4 class="code-header">pub fn <a href="#method.write_align" class="fn">write_align</a>(&mut self, align_start: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Write alignment padding bytes.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#96-98">Source</a><h4 class="code-header">pub fn <a href="#method.write" class="fn">write</a>(&mut self, data: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section></summary><div class="docblock"><p>Write data.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_until" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#101-104">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_until" class="fn">reserve_until</a>(&mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Reserve the file range up to the given file offset.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.pad_until" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#107-110">Source</a><h4 class="code-header">pub fn <a href="#method.pad_until" class="fn">pad_until</a>(&mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Write padding up to the given file offset.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_file_header" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#115-118">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_file_header" class="fn">reserve_file_header</a>(&mut self)</h4></section></summary><div class="docblock"><p>Reserve the range for the file header.</p>
|
|
<p>This must be at the start of the file.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_file_header" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#125-146">Source</a><h4 class="code-header">pub fn <a href="#method.write_file_header" class="fn">write_file_header</a>(&mut self, header: <a class="struct" href="struct.FileHeader.html" title="struct object::write::coff::FileHeader">FileHeader</a>) -> <a class="type" href="../type.Result.html" title="type object::write::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Write the file header.</p>
|
|
<p>This must be at the start of the file.</p>
|
|
<p>Fields that can be derived from known information are automatically set by this function.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_section_headers" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#149-156">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_section_headers" class="fn">reserve_section_headers</a>(&mut self, section_num: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u16.html">u16</a>)</h4></section></summary><div class="docblock"><p>Reserve the range for the section headers.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_section_header" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#159-218">Source</a><h4 class="code-header">pub fn <a href="#method.write_section_header" class="fn">write_section_header</a>(&mut self, section: <a class="struct" href="struct.SectionHeader.html" title="struct object::write::coff::SectionHeader">SectionHeader</a>)</h4></section></summary><div class="docblock"><p>Write a section header.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_section" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#224-230">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_section" class="fn">reserve_section</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Reserve the range for the section data.</p>
|
|
<p>Returns the aligned offset of the start of the range.
|
|
Does nothing and returns 0 if the length is zero.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_section_align" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#236-238">Source</a><h4 class="code-header">pub fn <a href="#method.write_section_align" class="fn">write_section_align</a>(&mut self)</h4></section></summary><div class="docblock"><p>Write the alignment bytes prior to section data.</p>
|
|
<p>This is unneeded if you are using <code>write_section</code> or <code>write_section_zeroes</code>
|
|
for the data.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_section" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#244-250">Source</a><h4 class="code-header">pub fn <a href="#method.write_section" class="fn">write_section</a>(&mut self, data: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>])</h4></section></summary><div class="docblock"><p>Write the section data.</p>
|
|
<p>Writes alignment bytes prior to the data.
|
|
Does nothing if the data is empty.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_section_zeroes" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#256-262">Source</a><h4 class="code-header">pub fn <a href="#method.write_section_zeroes" class="fn">write_section_zeroes</a>(&mut self, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Write the section data using zero bytes.</p>
|
|
<p>Writes alignment bytes prior to the data.
|
|
Does nothing if the length is zero.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_relocations" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#270-278">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_relocations" class="fn">reserve_relocations</a>(&mut self, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Reserve a file range for the given number of relocations.</p>
|
|
<p>This will automatically reserve an extra relocation if there are more than 0xffff.</p>
|
|
<p>Returns the offset of the range.
|
|
Does nothing and returns 0 if the count is zero.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_relocations_count" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#283-292">Source</a><h4 class="code-header">pub fn <a href="#method.write_relocations_count" class="fn">write_relocations_count</a>(&mut self, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Write a relocation containing the count if required.</p>
|
|
<p>This should be called before writing the first relocation for a section.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_relocation" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#295-302">Source</a><h4 class="code-header">pub fn <a href="#method.write_relocation" class="fn">write_relocation</a>(&mut self, reloc: <a class="struct" href="struct.Relocation.html" title="struct object::write::coff::Relocation">Relocation</a>)</h4></section></summary><div class="docblock"><p>Write a relocation.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_symbol_index" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#307-312">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_symbol_index" class="fn">reserve_symbol_index</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Reserve a symbol table entry.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_symbol_indices" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#315-318">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_symbol_indices" class="fn">reserve_symbol_indices</a>(&mut self, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</h4></section></summary><div class="docblock"><p>Reserve a number of symbol table entries.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_symbol" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#321-338">Source</a><h4 class="code-header">pub fn <a href="#method.write_symbol" class="fn">write_symbol</a>(&mut self, symbol: <a class="struct" href="struct.Symbol.html" title="struct object::write::coff::Symbol">Symbol</a>)</h4></section></summary><div class="docblock"><p>Write a symbol table entry.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_aux_file_name" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#345-350">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_aux_file_name" class="fn">reserve_aux_file_name</a>(&mut self, name: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Reserve auxiliary symbols for a file name.</p>
|
|
<p>Returns the number of auxiliary symbols required.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_aux_file_name" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#353-359">Source</a><h4 class="code-header">pub fn <a href="#method.write_aux_file_name" class="fn">write_aux_file_name</a>(&mut self, name: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>], aux_count: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>)</h4></section></summary><div class="docblock"><p>Write auxiliary symbols for a file name.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_aux_section" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#366-370">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_aux_section" class="fn">reserve_aux_section</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Reserve an auxiliary symbol for a section.</p>
|
|
<p>Returns the number of auxiliary symbols required.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_aux_section" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#373-389">Source</a><h4 class="code-header">pub fn <a href="#method.write_aux_section" class="fn">write_aux_section</a>(&mut self, section: <a class="struct" href="struct.AuxSymbolSection.html" title="struct object::write::coff::AuxSymbolSection">AuxSymbolSection</a>)</h4></section></summary><div class="docblock"><p>Write an auxiliary symbol for a section.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_aux_weak_external" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#396-400">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_aux_weak_external" class="fn">reserve_aux_weak_external</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Reserve an auxiliary symbol for a weak external.</p>
|
|
<p>Returns the number of auxiliary symbols required.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_aux_weak_external" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#403-412">Source</a><h4 class="code-header">pub fn <a href="#method.write_aux_weak_external" class="fn">write_aux_weak_external</a>(&mut self, weak: <a class="struct" href="struct.AuxSymbolWeak.html" title="struct object::write::coff::AuxSymbolWeak">AuxSymbolWeak</a>)</h4></section></summary><div class="docblock"><p>Write an auxiliary symbol for a weak external.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_count" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#415-417">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_count" class="fn">symbol_count</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Return the number of reserved symbol table entries.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_string" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#422-425">Source</a><h4 class="code-header">pub fn <a href="#method.add_string" class="fn">add_string</a>(&mut self, name: &'a [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="struct" href="../struct.StringId.html" title="struct object::write::StringId">StringId</a></h4></section></summary><div class="docblock"><p>Add a string to the string table.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_name" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#430-438">Source</a><h4 class="code-header">pub fn <a href="#method.add_name" class="fn">add_name</a>(&mut self, name: &'a [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="enum.Name.html" title="enum object::write::coff::Name">Name</a></h4></section></summary><div class="docblock"><p>Add a section or symbol name to the string table if required.</p>
|
|
<p>This must be called before <a href="struct.Writer.html#method.reserve_symtab_strtab" title="method object::write::coff::Writer::reserve_symtab_strtab"><code>Self::reserve_symtab_strtab</code></a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.reserve_symtab_strtab" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#444-453">Source</a><h4 class="code-header">pub fn <a href="#method.reserve_symtab_strtab" class="fn">reserve_symtab_strtab</a>(&mut self)</h4></section></summary><div class="docblock"><p>Reserve the range for the symbol table and string table.</p>
|
|
<p>This must be called after functions that reserve symbol
|
|
indices or add strings.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_strtab" class="method"><a class="src rightside" href="../../../src/object/write/coff/writer.rs.html#456-461">Source</a><h4 class="code-header">pub fn <a href="#method.write_strtab" class="fn">write_strtab</a>(&mut self)</h4></section></summary><div class="docblock"><p>Write the string table.</p>
|
|
</div></details></div></details></div><h2 id="synthetic-implementations" class="section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor">§</a></h2><div id="synthetic-implementations-list"><section id="impl-Freeze-for-Writer%3C'a%3E" class="impl"><a href="#impl-Freeze-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Freeze.html" title="trait core::marker::Freeze">Freeze</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-RefUnwindSafe-for-Writer%3C'a%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-Send-for-Writer%3C'a%3E" class="impl"><a href="#impl-Send-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-Sync-for-Writer%3C'a%3E" class="impl"><a href="#impl-Sync-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-Unpin-for-Writer%3C'a%3E" class="impl"><a href="#impl-Unpin-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-UnsafeUnpin-for-Writer%3C'a%3E" class="impl"><a href="#impl-UnsafeUnpin-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.UnsafeUnpin.html" title="trait core::marker::UnsafeUnpin">UnsafeUnpin</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section><section id="impl-UnwindSafe-for-Writer%3C'a%3E" class="impl"><a href="#impl-UnwindSafe-for-Writer%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Writer.html" title="struct object::write::coff::Writer">Writer</a><'a></h3></section></div><h2 id="blanket-implementations" class="section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor">§</a></h2><div id="blanket-implementations-list"><details class="toggle implementors-toggle"><summary><section id="impl-Any-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#141">Source</a><a href="#impl-Any-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T<div class="where">where
|
|
T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#142">Source</a><a href="#method.type_id" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fn">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#212">Source</a><a href="#impl-Borrow%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T<div class="where">where
|
|
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214">Source</a><a href="#method.borrow" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fn">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&T</a></h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#221">Source</a><a href="#impl-BorrowMut%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<div class="where">where
|
|
T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#222">Source</a><a href="#method.borrow_mut" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fn">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut T</a></h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#785">Source</a><a href="#impl-From%3CT%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#788">Source</a><a href="#method.from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fn">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#767-769">Source</a><a href="#impl-Into%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#777">Source</a><a href="#method.into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fn">into</a>(self) -> U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
|
|
<p>That is, this conversion is whatever the implementation of
|
|
<code><a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
|
|
</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#827-829">Source</a><a href="#impl-TryFrom%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#831">Source</a><a href="#associatedtype.Error-1" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#834">Source</a><a href="#method.try_from" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fn">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-T" class="impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#811-813">Source</a><a href="#impl-TryInto%3CU%3E-for-T" class="anchor">§</a><h3 class="code-header">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T<div class="where">where
|
|
U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><div class="impl-items"><details class="toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#815">Source</a><a href="#associatedtype.Error" class="anchor">§</a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl"><a class="src rightside" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#818">Source</a><a href="#method.try_into" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fn">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html> |