mirror of
https://github.com/Rust-GPU/rust-gpu.git
synced 2026-06-07 10:09:51 +09:00
202 lines
67 KiB
HTML
202 lines
67 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 writable relocatable object file."><title>Object in object::write - 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="#">Object</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="#">Object</a></h2><h3><a href="#fields">Fields</a></h3><ul class="block structfield"><li><a href="#structfield.flags" title="flags">flags</a></li><li><a href="#structfield.mangling" title="mangling">mangling</a></li></ul><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_coff_exports" title="add_coff_exports">add_coff_exports</a></li><li><a href="#method.add_comdat" title="add_comdat">add_comdat</a></li><li><a href="#method.add_common_symbol" title="add_common_symbol">add_common_symbol</a></li><li><a href="#method.add_elf_gnu_property_u32" title="add_elf_gnu_property_u32">add_elf_gnu_property_u32</a></li><li><a href="#method.add_file_symbol" title="add_file_symbol">add_file_symbol</a></li><li><a href="#method.add_relocation" title="add_relocation">add_relocation</a></li><li><a href="#method.add_section" title="add_section">add_section</a></li><li><a href="#method.add_subsection" title="add_subsection">add_subsection</a></li><li><a href="#method.add_symbol" title="add_symbol">add_symbol</a></li><li><a href="#method.add_symbol_bss" title="add_symbol_bss">add_symbol_bss</a></li><li><a href="#method.add_symbol_data" title="add_symbol_data">add_symbol_data</a></li><li><a href="#method.append_section_bss" title="append_section_bss">append_section_bss</a></li><li><a href="#method.append_section_data" title="append_section_data">append_section_data</a></li><li><a href="#method.architecture" title="architecture">architecture</a></li><li><a href="#method.comdat" title="comdat">comdat</a></li><li><a href="#method.comdat_mut" title="comdat_mut">comdat_mut</a></li><li><a href="#method.default_section_flags" title="default_section_flags">default_section_flags</a></li><li><a href="#method.default_symbol_flags" title="default_symbol_flags">default_symbol_flags</a></li><li><a href="#method.emit" title="emit">emit</a></li><li><a href="#method.format" title="format">format</a></li><li><a href="#method.has_common" title="has_common">has_common</a></li><li><a href="#method.has_uninitialized_tls" title="has_uninitialized_tls">has_uninitialized_tls</a></li><li><a href="#method.mangling" title="mangling">mangling</a></li><li><a href="#method.section" title="section">section</a></li><li><a href="#method.section_flags" title="section_flags">section_flags</a></li><li><a href="#method.section_flags_mut" title="section_flags_mut">section_flags_mut</a></li><li><a href="#method.section_id" title="section_id">section_id</a></li><li><a href="#method.section_mut" title="section_mut">section_mut</a></li><li><a href="#method.section_symbol" title="section_symbol">section_symbol</a></li><li><a href="#method.segment_name" title="segment_name">segment_name</a></li><li><a href="#method.set_macho_build_version" title="set_macho_build_version">set_macho_build_version</a></li><li><a href="#method.set_macho_cpu_subtype" title="set_macho_cpu_subtype">set_macho_cpu_subtype</a></li><li><a href="#method.set_mangling" title="set_mangling">set_mangling</a></li><li><a href="#method.set_section_data" title="set_section_data">set_section_data</a></li><li><a href="#method.set_sub_architecture" title="set_sub_architecture">set_sub_architecture</a></li><li><a href="#method.set_subsections_via_symbols" title="set_subsections_via_symbols">set_subsections_via_symbols</a></li><li><a href="#method.set_symbol_data" title="set_symbol_data">set_symbol_data</a></li><li><a href="#method.sub_architecture" title="sub_architecture">sub_architecture</a></li><li><a href="#method.symbol" title="symbol">symbol</a></li><li><a href="#method.symbol_flags" title="symbol_flags">symbol_flags</a></li><li><a href="#method.symbol_flags_mut" title="symbol_flags_mut">symbol_flags_mut</a></li><li><a href="#method.symbol_id" title="symbol_id">symbol_id</a></li><li><a href="#method.symbol_mut" title="symbol_mut">symbol_mut</a></li><li><a href="#method.symbol_section_and_offset" title="symbol_section_and_offset">symbol_section_and_offset</a></li><li><a href="#method.write" title="write">write</a></li><li><a href="#method.write_stream" title="write_stream">write_stream</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-Debug-for-Object%3C'a%3E" title="Debug">Debug</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block synthetic-implementation"><li><a href="#impl-Freeze-for-Object%3C'a%3E" title="Freeze">Freeze</a></li><li><a href="#impl-RefUnwindSafe-for-Object%3C'a%3E" title="RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send-for-Object%3C'a%3E" title="Send">Send</a></li><li><a href="#impl-Sync-for-Object%3C'a%3E" title="Sync">Sync</a></li><li><a href="#impl-Unpin-for-Object%3C'a%3E" title="Unpin">Unpin</a></li><li><a href="#impl-UnsafeUnpin-for-Object%3C'a%3E" title="UnsafeUnpin">UnsafeUnpin</a></li><li><a href="#impl-UnwindSafe-for-Object%3C'a%3E" title="UnwindSafe">UnwindSafe</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</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></div><h1>Struct <span class="struct">Object</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/mod.rs.html#71-98">Source</a> </span></div><pre class="rust item-decl"><code>pub struct Object<'a> {
|
||
pub flags: <a class="enum" href="../enum.FileFlags.html" title="enum object::FileFlags">FileFlags</a>,
|
||
pub mangling: <a class="enum" href="enum.Mangling.html" title="enum object::write::Mangling">Mangling</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 writable relocatable object file.</p>
|
||
</div></details><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield.flags" class="structfield section-header"><a href="#structfield.flags" class="anchor field">§</a><code>flags: <a class="enum" href="../enum.FileFlags.html" title="enum object::FileFlags">FileFlags</a></code></span><div class="docblock"><p>File flags that are specific to each file format.</p>
|
||
</div><span id="structfield.mangling" class="structfield section-header"><a href="#structfield.mangling" class="anchor field">§</a><code>mangling: <a class="enum" href="enum.Mangling.html" title="enum object::write::Mangling">Mangling</a></code></span><div class="docblock"><p>The symbol name mangling scheme.</p>
|
||
</div><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-Object%3C'a%3E" class="impl"><a class="src rightside" href="../../src/object/write/coff/object.rs.html#35-824">Source</a><a href="#impl-Object%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.add_coff_exports" class="method"><a class="src rightside" href="../../src/object/write/coff/object.rs.html#367-389">Source</a><h4 class="code-header">pub fn <a href="#method.add_coff_exports" class="fn">add_coff_exports</a>(&mut self, style: <a class="enum" href="coff/enum.CoffExportStyle.html" title="enum object::write::coff::CoffExportStyle">CoffExportStyle</a>)</h4></section></summary><div class="docblock"><p>Appends linker directives to the <code>.drectve</code> section to tell the linker
|
||
to export all symbols with <code>SymbolScope::Dynamic</code>.</p>
|
||
<p>This must be called after all symbols have been defined.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Object%3C'a%3E-1" class="impl"><a class="src rightside" href="../../src/object/write/elf/object.rs.html#30-59">Source</a><a href="#impl-Object%3C'a%3E-1" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.add_elf_gnu_property_u32" class="method"><a class="src rightside" href="../../src/object/write/elf/object.rs.html#34-58">Source</a><h4 class="code-header">pub fn <a href="#method.add_elf_gnu_property_u32" class="fn">add_elf_gnu_property_u32</a>(&mut self, property: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</h4></section></summary><div class="docblock"><p>Add a property with a u32 value to the ELF “.note.gnu.property” section.</p>
|
||
<p>Requires <code>feature = "elf"</code>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Object%3C'a%3E-2" class="impl"><a class="src rightside" href="../../src/object/write/macho.rs.html#49-65">Source</a><a href="#impl-Object%3C'a%3E-2" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.set_macho_cpu_subtype" class="method"><a class="src rightside" href="../../src/object/write/macho.rs.html#54-56">Source</a><h4 class="code-header">pub fn <a href="#method.set_macho_cpu_subtype" class="fn">set_macho_cpu_subtype</a>(&mut self, cpu_subtype: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>)</h4></section></summary><div class="docblock"><p>Specify the Mach-O CPU subtype.</p>
|
||
<p>Requires <code>feature = "macho"</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_macho_build_version" class="method"><a class="src rightside" href="../../src/object/write/macho.rs.html#62-64">Source</a><h4 class="code-header">pub fn <a href="#method.set_macho_build_version" class="fn">set_macho_build_version</a>(&mut self, info: <a class="struct" href="struct.MachOBuildVersion.html" title="struct object::write::MachOBuildVersion">MachOBuildVersion</a>)</h4></section></summary><div class="docblock"><p>Specify information for a Mach-O <code>LC_BUILD_VERSION</code> command.</p>
|
||
<p>Requires <code>feature = "macho"</code>.</p>
|
||
</div></details></div></details><details class="toggle implementors-toggle" open><summary><section id="impl-Object%3C'a%3E-3" class="impl"><a class="src rightside" href="../../src/object/write/mod.rs.html#100-797">Source</a><a href="#impl-Object%3C'a%3E-3" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</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/mod.rs.html#102-126">Source</a><h4 class="code-header">pub fn <a href="#method.new" class="fn">new</a>(
|
||
format: <a class="enum" href="../enum.BinaryFormat.html" title="enum object::BinaryFormat">BinaryFormat</a>,
|
||
architecture: <a class="enum" href="../enum.Architecture.html" title="enum object::Architecture">Architecture</a>,
|
||
endian: <a class="enum" href="../endian/enum.Endianness.html" title="enum object::endian::Endianness">Endianness</a>,
|
||
) -> <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</a><'a></h4></section></summary><div class="docblock"><p>Create an empty object file.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.format" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#130-132">Source</a><h4 class="code-header">pub fn <a href="#method.format" class="fn">format</a>(&self) -> <a class="enum" href="../enum.BinaryFormat.html" title="enum object::BinaryFormat">BinaryFormat</a></h4></section></summary><div class="docblock"><p>Return the file format.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.architecture" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#136-138">Source</a><h4 class="code-header">pub fn <a href="#method.architecture" class="fn">architecture</a>(&self) -> <a class="enum" href="../enum.Architecture.html" title="enum object::Architecture">Architecture</a></h4></section></summary><div class="docblock"><p>Return the architecture.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.sub_architecture" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#142-144">Source</a><h4 class="code-header">pub fn <a href="#method.sub_architecture" class="fn">sub_architecture</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../enum.SubArchitecture.html" title="enum object::SubArchitecture">SubArchitecture</a>></h4></section></summary><div class="docblock"><p>Return the sub-architecture.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_sub_architecture" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#147-149">Source</a><h4 class="code-header">pub fn <a href="#method.set_sub_architecture" class="fn">set_sub_architecture</a>(
|
||
&mut self,
|
||
sub_architecture: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="../enum.SubArchitecture.html" title="enum object::SubArchitecture">SubArchitecture</a>>,
|
||
)</h4></section></summary><div class="docblock"><p>Specify the sub-architecture.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.mangling" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#153-155">Source</a><h4 class="code-header">pub fn <a href="#method.mangling" class="fn">mangling</a>(&self) -> <a class="enum" href="enum.Mangling.html" title="enum object::write::Mangling">Mangling</a></h4></section></summary><div class="docblock"><p>Return the current mangling setting.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_mangling" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#159-161">Source</a><h4 class="code-header">pub fn <a href="#method.set_mangling" class="fn">set_mangling</a>(&mut self, mangling: <a class="enum" href="enum.Mangling.html" title="enum object::write::Mangling">Mangling</a>)</h4></section></summary><div class="docblock"><p>Specify the mangling setting.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.segment_name" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#167-177">Source</a><h4 class="code-header">pub fn <a href="#method.segment_name" class="fn">segment_name</a>(&self, segment: <a class="enum" href="enum.StandardSegment.html" title="enum object::write::StandardSegment">StandardSegment</a>) -> &'static [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>] <a href="#" class="tooltip" data-notable-ty="&'static [u8]">ⓘ</a></h4></section></summary><div class="docblock"><p>Return the name for a standard segment.</p>
|
||
<p>This will vary based on the file format.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#181-183">Source</a><h4 class="code-header">pub fn <a href="#method.section" class="fn">section</a>(&self, section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>) -> &<a class="struct" href="struct.Section.html" title="struct object::write::Section">Section</a><'a></h4></section></summary><div class="docblock"><p>Get the section with the given <code>SectionId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section_mut" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#187-189">Source</a><h4 class="code-header">pub fn <a href="#method.section_mut" class="fn">section_mut</a>(&mut self, section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>) -> &mut <a class="struct" href="struct.Section.html" title="struct object::write::Section">Section</a><'a></h4></section></summary><div class="docblock"><p>Mutably get the section with the given <code>SectionId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_section_data" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#195-200">Source</a><h4 class="code-header">pub fn <a href="#method.set_section_data" class="fn">set_section_data</a><T>(&mut self, section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>, data: T, align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)<div class="where">where
|
||
T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a><'a, [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]>>,</div></h4></section></summary><div class="docblock"><p>Set the data for an existing section.</p>
|
||
<p>Must not be called for sections that already have data, or that contain uninitialized data.
|
||
<code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.append_section_data" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#206-208">Source</a><h4 class="code-header">pub fn <a href="#method.append_section_data" class="fn">append_section_data</a>(
|
||
&mut self,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
data: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>],
|
||
align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Append data to an existing section. Returns the section offset of the data.</p>
|
||
<p>Must not be called for sections that contain uninitialized data.
|
||
<code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.append_section_bss" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#214-216">Source</a><h4 class="code-header">pub fn <a href="#method.append_section_bss" class="fn">append_section_bss</a>(
|
||
&mut self,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Append zero-initialized data to an existing section. Returns the section offset of the data.</p>
|
||
<p>Must not be called for sections that contain initialized data.
|
||
<code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section_id" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#221-231">Source</a><h4 class="code-header">pub fn <a href="#method.section_id" class="fn">section_id</a>(&mut self, section: <a class="enum" href="enum.StandardSection.html" title="enum object::write::StandardSection">StandardSection</a>) -> <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a></h4></section></summary><div class="docblock"><p>Return the <code>SectionId</code> of a standard section.</p>
|
||
<p>If the section doesn’t already exist then it is created.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_section" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#236-262">Source</a><h4 class="code-header">pub fn <a href="#method.add_section" class="fn">add_section</a>(
|
||
&mut self,
|
||
segment: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
||
name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>,
|
||
kind: <a class="enum" href="../enum.SectionKind.html" title="enum object::SectionKind">SectionKind</a>,
|
||
) -> <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a></h4></section></summary><div class="docblock"><p>Add a new section and return its <code>SectionId</code>.</p>
|
||
<p>This also creates a section symbol.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_subsection" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#286-295">Source</a><h4 class="code-header">pub fn <a href="#method.add_subsection" class="fn">add_subsection</a>(
|
||
&mut self,
|
||
section: <a class="enum" href="enum.StandardSection.html" title="enum object::write::StandardSection">StandardSection</a>,
|
||
name: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>],
|
||
) -> <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a></h4></section></summary><div class="docblock"><p>Add a subsection. Returns the <code>SectionId</code> and section offset of the data.</p>
|
||
<p>For Mach-O, this does not create a subsection, and instead uses the
|
||
section from <a href="struct.Object.html#method.section_id" title="method object::write::Object::section_id"><code>Self::section_id</code></a>. Use <a href="struct.Object.html#method.set_subsections_via_symbols" title="method object::write::Object::set_subsections_via_symbols"><code>Self::set_subsections_via_symbols</code></a>
|
||
to enable subsections via symbols.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_subsections_via_symbols" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#307-312">Source</a><h4 class="code-header">pub fn <a href="#method.set_subsections_via_symbols" class="fn">set_subsections_via_symbols</a>(&mut self)</h4></section></summary><div class="docblock"><p>Enable subsections via symbols if supported.</p>
|
||
<p>This should be called before adding any subsections or symbols.</p>
|
||
<p>For Mach-O, this sets the <code>MH_SUBSECTIONS_VIA_SYMBOLS</code> flag.
|
||
For other formats, this does nothing.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.default_section_flags" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#345-357">Source</a><h4 class="code-header">pub fn <a href="#method.default_section_flags" class="fn">default_section_flags</a>(&self, section: &<a class="struct" href="struct.Section.html" title="struct object::write::Section">Section</a><'_>) -> <a class="enum" href="../enum.SectionFlags.html" title="enum object::SectionFlags">SectionFlags</a></h4></section></summary><div class="docblock"><p>Return the default flags for a section.</p>
|
||
<p>The default flags are the section flags that will be written if
|
||
the section flags are set to <code>SectionFlags::None</code>.
|
||
These flags are determined by the file format and fields in the section
|
||
such as the section kind.</p>
|
||
<p>This may return <code>SectionFlags::None</code> if the file format does not support
|
||
the section kind.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section_flags" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#364-370">Source</a><h4 class="code-header">pub fn <a href="#method.section_flags" class="fn">section_flags</a>(&self, section: &<a class="struct" href="struct.Section.html" title="struct object::write::Section">Section</a><'_>) -> <a class="enum" href="../enum.SectionFlags.html" title="enum object::SectionFlags">SectionFlags</a></h4></section></summary><div class="docblock"><p>Return the flags for a section.</p>
|
||
<p>If <code>section.flags</code> is <code>SectionFlags::None</code>, then returns
|
||
<a href="struct.Object.html#method.default_section_flags" title="method object::write::Object::default_section_flags"><code>Self::default_section_flags</code></a>.
|
||
Otherwise, <code>section.flags</code> is returned as is.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section_flags_mut" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#377-386">Source</a><h4 class="code-header">pub fn <a href="#method.section_flags_mut" class="fn">section_flags_mut</a>(&mut self, section_id: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>) -> &mut <a class="enum" href="../enum.SectionFlags.html" title="enum object::SectionFlags">SectionFlags</a></h4></section></summary><div class="docblock"><p>Mutably get the flags for a section.</p>
|
||
<p>If <code>section.flags</code> is <code>SectionFlags::None</code>, then replace it with
|
||
<a href="struct.Object.html#method.default_section_flags" title="method object::write::Object::default_section_flags"><code>Self::default_section_flags</code></a> first.
|
||
Otherwise, <code>&mut section.flags</code> is returned as is.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.comdat" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#390-392">Source</a><h4 class="code-header">pub fn <a href="#method.comdat" class="fn">comdat</a>(&self, comdat: <a class="struct" href="struct.ComdatId.html" title="struct object::write::ComdatId">ComdatId</a>) -> &<a class="struct" href="struct.Comdat.html" title="struct object::write::Comdat">Comdat</a></h4></section></summary><div class="docblock"><p>Get the COMDAT section group with the given <code>ComdatId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.comdat_mut" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#396-398">Source</a><h4 class="code-header">pub fn <a href="#method.comdat_mut" class="fn">comdat_mut</a>(&mut self, comdat: <a class="struct" href="struct.ComdatId.html" title="struct object::write::ComdatId">ComdatId</a>) -> &mut <a class="struct" href="struct.Comdat.html" title="struct object::write::Comdat">Comdat</a></h4></section></summary><div class="docblock"><p>Mutably get the COMDAT section group with the given <code>ComdatId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_comdat" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#401-405">Source</a><h4 class="code-header">pub fn <a href="#method.add_comdat" class="fn">add_comdat</a>(&mut self, comdat: <a class="struct" href="struct.Comdat.html" title="struct object::write::Comdat">Comdat</a>) -> <a class="struct" href="struct.ComdatId.html" title="struct object::write::ComdatId">ComdatId</a></h4></section></summary><div class="docblock"><p>Add a new COMDAT section group and return its <code>ComdatId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_id" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#408-410">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_id" class="fn">symbol_id</a>(&self, name: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>]) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>></h4></section></summary><div class="docblock"><p>Get the <code>SymbolId</code> of the symbol with the given name.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#414-416">Source</a><h4 class="code-header">pub fn <a href="#method.symbol" class="fn">symbol</a>(&self, symbol: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>) -> &<a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a></h4></section></summary><div class="docblock"><p>Get the symbol with the given <code>SymbolId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_mut" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#420-422">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_mut" class="fn">symbol_mut</a>(&mut self, symbol: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>) -> &mut <a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a></h4></section></summary><div class="docblock"><p>Mutably get the symbol with the given <code>SymbolId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_symbol" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#432-459">Source</a><h4 class="code-header">pub fn <a href="#method.add_symbol" class="fn">add_symbol</a>(&mut self, symbol: <a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a>) -> <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a></h4></section></summary><div class="docblock"><p>Add a new symbol and return its <code>SymbolId</code>.</p>
|
||
<p>If the symbol is a section symbol that is already defined,
|
||
it will update the flags of the existing section symbol
|
||
instead of creating adding a new symbol.</p>
|
||
<p>The symbol name will be modified to include the global prefix
|
||
if the mangling scheme has one.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.default_symbol_flags" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#477-489">Source</a><h4 class="code-header">pub fn <a href="#method.default_symbol_flags" class="fn">default_symbol_flags</a>(
|
||
&self,
|
||
symbol: &<a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a>,
|
||
) -> <a class="enum" href="../enum.SymbolFlags.html" title="enum object::SymbolFlags">SymbolFlags</a><<a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>, <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>></h4></section></summary><div class="docblock"><p>Return the default flags for a symbol.</p>
|
||
<p>The default flags are the symbol flags that will be written if the
|
||
symbol flags are set to <code>SymbolFlags::None</code>. These flags are determined
|
||
by the file format and fields in the symbol such as the symbol kind and
|
||
scope. Therefore you should call this function after the symbol
|
||
has been fully defined.</p>
|
||
<p>This may return <code>SymbolFlags::None</code> if the file format does not
|
||
support symbol flags, or does not support the symbol kind or scope.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_flags" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#496-502">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_flags" class="fn">symbol_flags</a>(&self, symbol: &<a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a>) -> <a class="enum" href="../enum.SymbolFlags.html" title="enum object::SymbolFlags">SymbolFlags</a><<a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>, <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>></h4></section></summary><div class="docblock"><p>Return the flags for a symbol.</p>
|
||
<p>If <code>symbol.flags</code> is <code>SymbolFlags::None</code>, then returns
|
||
<a href="struct.Object.html#method.default_symbol_flags" title="method object::write::Object::default_symbol_flags"><code>Self::default_symbol_flags</code></a>.
|
||
Otherwise, <code>symbol.flags</code> is returned as is.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_flags_mut" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#509-521">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_flags_mut" class="fn">symbol_flags_mut</a>(
|
||
&mut self,
|
||
symbol_id: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>,
|
||
) -> &mut <a class="enum" href="../enum.SymbolFlags.html" title="enum object::SymbolFlags">SymbolFlags</a><<a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>, <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>></h4></section></summary><div class="docblock"><p>Mutably get the flags for a symbol.</p>
|
||
<p>If <code>symbol.flags</code> is <code>SymbolFlags::None</code>, then replace it with
|
||
<a href="struct.Object.html#method.default_symbol_flags" title="method object::write::Object::default_symbol_flags"><code>Self::default_symbol_flags</code></a>.
|
||
Otherwise, <code>&mut symbol.flags</code> is returned as is.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_uninitialized_tls" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#525-527">Source</a><h4 class="code-header">pub fn <a href="#method.has_uninitialized_tls" class="fn">has_uninitialized_tls</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return true if the file format supports <code>StandardSection::UninitializedTls</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.has_common" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#531-533">Source</a><h4 class="code-header">pub fn <a href="#method.has_common" class="fn">has_common</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return true if the file format supports <code>StandardSection::Common</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_common_symbol" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#540-551">Source</a><h4 class="code-header">pub fn <a href="#method.add_common_symbol" class="fn">add_common_symbol</a>(
|
||
&mut self,
|
||
symbol: <a class="struct" href="struct.Symbol.html" title="struct object::write::Symbol">Symbol</a>,
|
||
size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
) -> <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a></h4></section></summary><div class="docblock"><p>Add a new common symbol and return its <code>SymbolId</code>.</p>
|
||
<p>For Mach-O, this appends the symbol to the <code>__common</code> section.</p>
|
||
<p><code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_file_symbol" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#554-565">Source</a><h4 class="code-header">pub fn <a href="#method.add_file_symbol" class="fn">add_file_symbol</a>(&mut self, name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>) -> <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a></h4></section></summary><div class="docblock"><p>Add a new file symbol and return its <code>SymbolId</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.section_symbol" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#568-591">Source</a><h4 class="code-header">pub fn <a href="#method.section_symbol" class="fn">section_symbol</a>(&mut self, section_id: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>) -> <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a></h4></section></summary><div class="docblock"><p>Get the symbol for a section.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_symbol_data" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#605-619">Source</a><h4 class="code-header">pub fn <a href="#method.add_symbol_data" class="fn">add_symbol_data</a>(
|
||
&mut self,
|
||
symbol_id: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
data: &[<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>],
|
||
align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Append data to an existing section, and update a symbol to refer to it.</p>
|
||
<p>For Mach-O, this also creates a <code>__thread_vars</code> entry for TLS symbols, and the
|
||
symbol will indirectly point to the added data via the <code>__thread_vars</code> entry.</p>
|
||
<p>For Mach-O, if <a href="struct.Object.html#method.set_subsections_via_symbols" title="method object::write::Object::set_subsections_via_symbols"><code>Self::set_subsections_via_symbols</code></a> is enabled, this will
|
||
automatically ensure the data size is at least 1.</p>
|
||
<p>Returns the section offset of the data.</p>
|
||
<p>Must not be called for sections that contain uninitialized data.
|
||
<code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_symbol_bss" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#633-647">Source</a><h4 class="code-header">pub fn <a href="#method.add_symbol_bss" class="fn">add_symbol_bss</a>(
|
||
&mut self,
|
||
symbol_id: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
align: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></h4></section></summary><div class="docblock"><p>Append zero-initialized data to an existing section, and update a symbol to refer to it.</p>
|
||
<p>For Mach-O, this also creates a <code>__thread_vars</code> entry for TLS symbols, and the
|
||
symbol will indirectly point to the added data via the <code>__thread_vars</code> entry.</p>
|
||
<p>For Mach-O, if <a href="struct.Object.html#method.set_subsections_via_symbols" title="method object::write::Object::set_subsections_via_symbols"><code>Self::set_subsections_via_symbols</code></a> is enabled, this will
|
||
automatically ensure the data size is at least 1.</p>
|
||
<p>Returns the section offset of the data.</p>
|
||
<p>Must not be called for sections that contain initialized data.
|
||
<code>align</code> must be a power of two.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.set_symbol_data" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#654-672">Source</a><h4 class="code-header">pub fn <a href="#method.set_symbol_data" class="fn">set_symbol_data</a>(
|
||
&mut self,
|
||
symbol_id: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
|
||
)</h4></section></summary><div class="docblock"><p>Update a symbol to refer to the given data within a section.</p>
|
||
<p>For Mach-O, this also creates a <code>__thread_vars</code> entry for TLS symbols, and the
|
||
symbol will indirectly point to the data via the <code>__thread_vars</code> entry.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.symbol_section_and_offset" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#677-686">Source</a><h4 class="code-header">pub fn <a href="#method.symbol_section_and_offset" class="fn">symbol_section_and_offset</a>(
|
||
&mut self,
|
||
symbol_id: <a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><(<a class="struct" href="struct.SymbolId.html" title="struct object::write::SymbolId">SymbolId</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>)></h4></section></summary><div class="docblock"><p>Convert a symbol to a section symbol and offset.</p>
|
||
<p>Returns <code>None</code> if the symbol does not have a section.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.add_relocation" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#692-721">Source</a><h4 class="code-header">pub fn <a href="#method.add_relocation" class="fn">add_relocation</a>(
|
||
&mut self,
|
||
section: <a class="struct" href="struct.SectionId.html" title="struct object::write::SectionId">SectionId</a>,
|
||
relocation: <a class="struct" href="struct.Relocation.html" title="struct object::write::Relocation">Relocation</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>Add a relocation to a section.</p>
|
||
<p>Relocations must only be added after the referenced symbols have been added
|
||
and defined (if applicable).</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.write" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#762-766">Source</a><h4 class="code-header">pub fn <a href="#method.write" class="fn">write</a>(&self) -> <a class="type" href="type.Result.html" title="type object::write::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<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 object to a <code>Vec</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.write_stream" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#775-781">Source</a><h4 class="code-header">pub fn <a href="#method.write_stream" class="fn">write_stream</a><W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a>>(&self, w: W) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/error/trait.Error.html" title="trait core::error::Error">Error</a>>></h4></section></summary><div class="docblock"><p>Write the object to a <code>Write</code> implementation.</p>
|
||
<p>Also flushes the writer.</p>
|
||
<p>It is advisable to use a buffered writer like <a href="https://doc.rust-lang.org/nightly/std/io/buffered/bufwriter/struct.BufWriter.html" title="struct std::io::buffered::bufwriter::BufWriter"><code>BufWriter</code></a>
|
||
instead of an unbuffered writer like <a href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File"><code>File</code></a>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.emit" class="method"><a class="src rightside" href="../../src/object/write/mod.rs.html#784-796">Source</a><h4 class="code-header">pub fn <a href="#method.emit" class="fn">emit</a>(&self, buffer: &mut dyn <a class="trait" href="trait.WritableBuffer.html" title="trait object::write::WritableBuffer">WritableBuffer</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 object to a <code>WritableBuffer</code>.</p>
|
||
</div></details></div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-Debug-for-Object%3C'a%3E" class="impl"><a class="src rightside" href="../../src/object/write/mod.rs.html#70">Source</a><a href="#impl-Debug-for-Object%3C'a%3E" class="anchor">§</a><h3 class="code-header">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.Object.html" title="struct object::write::Object">Object</a><'a></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl"><a class="src rightside" href="../../src/object/write/mod.rs.html#70">Source</a><a href="#method.fmt" class="anchor">§</a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fn">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></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-Object%3C'a%3E" class="impl"><a href="#impl-Freeze-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-RefUnwindSafe-for-Object%3C'a%3E" class="impl"><a href="#impl-RefUnwindSafe-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-Send-for-Object%3C'a%3E" class="impl"><a href="#impl-Send-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-Sync-for-Object%3C'a%3E" class="impl"><a href="#impl-Sync-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-Unpin-for-Object%3C'a%3E" class="impl"><a href="#impl-Unpin-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-UnsafeUnpin-for-Object%3C'a%3E" class="impl"><a href="#impl-UnsafeUnpin-for-Object%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.Object.html" title="struct object::write::Object">Object</a><'a></h3></section><section id="impl-UnwindSafe-for-Object%3C'a%3E" class="impl"><a href="#impl-UnwindSafe-for-Object%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.Object.html" title="struct object::write::Object">Object</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><script type="text/json" id="notable-traits-data">{"&'static [u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html> |