wasmer/rustdoc/inkwell/context/struct.ContextRef.html
2019-09-06 15:57:44 -07:00

352 lines
81 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `ContextRef` struct in crate `inkwell`."><meta name="keywords" content="rust, rustlang, rust-lang, ContextRef"><title>inkwell::context::ContextRef - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../inkwell/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Struct ContextRef</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#deref-methods">Methods from Deref&lt;Target=Context&gt;</a><div class="sidebar-links"><a href="#method.append_basic_block">append_basic_block</a><a href="#method.bool_type">bool_type</a><a href="#method.const_string">const_string</a><a href="#method.const_struct">const_struct</a><a href="#method.create_builder">create_builder</a><a href="#method.create_enum_attribute">create_enum_attribute</a><a href="#method.create_module">create_module</a><a href="#method.create_module_from_ir">create_module_from_ir</a><a href="#method.create_string_attribute">create_string_attribute</a><a href="#method.custom_width_int_type">custom_width_int_type</a><a href="#method.f128_type">f128_type</a><a href="#method.f16_type">f16_type</a><a href="#method.f32_type">f32_type</a><a href="#method.f64_type">f64_type</a><a href="#method.get_kind_id">get_kind_id</a><a href="#method.i128_type">i128_type</a><a href="#method.i16_type">i16_type</a><a href="#method.i32_type">i32_type</a><a href="#method.i64_type">i64_type</a><a href="#method.i8_type">i8_type</a><a href="#method.insert_basic_block_after">insert_basic_block_after</a><a href="#method.metadata_node">metadata_node</a><a href="#method.metadata_string">metadata_string</a><a href="#method.opaque_struct_type">opaque_struct_type</a><a href="#method.ppc_f128_type">ppc_f128_type</a><a href="#method.prepend_basic_block">prepend_basic_block</a><a href="#method.struct_type">struct_type</a><a href="#method.void_type">void_type</a><a href="#method.x86_f80_type">x86_f80_type</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-Drop">Drop</a><a href="#impl-Eq">Eq</a><a href="#impl-PartialEq%3CContextRef%3E">PartialEq&lt;ContextRef&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow&lt;T&gt;</a><a href="#impl-BorrowMut%3CT%3E">BorrowMut&lt;T&gt;</a><a href="#impl-From%3CT%3E">From&lt;T&gt;</a><a href="#impl-Into%3CU%3E">Into&lt;U&gt;</a><a href="#impl-TryFrom%3CU%3E">TryFrom&lt;U&gt;</a><a href="#impl-TryInto%3CU%3E">TryInto&lt;U&gt;</a></div></div><p class='location'><a href='../index.html'>inkwell</a>::<wbr><a href='index.html'>context</a></p><script>window.sidebarCurrent = {name: 'ContextRef', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/inkwell/context.rs.html#821-823' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>inkwell</a>::<wbr><a href='index.html'>context</a>::<wbr><a class="struct" href=''>ContextRef</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct ContextRef { /* fields omitted */ }</pre></div><div class='docblock'><p>A <code>ContextRef</code> is a smart pointer allowing borrowed access to a a type's <code>Context</code>.</p>
</div><h2 id='deref-methods' class='small-section-header'>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a>&lt;Target = <a class="struct" href="../../inkwell/context/struct.Context.html" title="struct inkwell::context::Context">Context</a>&gt;<a href='#deref-methods' class='anchor'></a></h2><div class='impl-items'><h4 id='method.create_builder' class="method"><code id='create_builder.v'>pub fn <a href='#method.create_builder' class='fnname'>create_builder</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/builder/struct.Builder.html" title="struct inkwell::builder::Builder">Builder</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#95-101' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new <code>Builder</code> for a <code>Context</code>.</p>
<h1 id="example" class="section-header"><a href="#example">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_builder</span>();</pre></div>
</div><h4 id='method.create_module' class="method"><code id='create_module.v'>pub fn <a href='#method.create_module' class='fnname'>create_module</a>(&amp;self, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../inkwell/module/struct.Module.html" title="struct inkwell::module::Module">Module</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#113-121' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new <code>Module</code> for a <code>Context</code>.</p>
<h1 id="example-1" class="section-header"><a href="#example-1">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">module</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module</span>(<span class="string">&quot;my_module&quot;</span>);</pre></div>
</div><h4 id='method.create_module_from_ir' class="method"><code id='create_module_from_ir.v'>pub fn <a href='#method.create_module_from_ir' class='fnname'>create_module_from_ir</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;memory_buffer: <a class="struct" href="../../inkwell/memory_buffer/struct.MemoryBuffer.html" title="struct inkwell::memory_buffer::MemoryBuffer">MemoryBuffer</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../../inkwell/module/struct.Module.html" title="struct inkwell::module::Module">Module</a>, <a class="struct" href="../../inkwell/support/struct.LLVMString.html" title="struct inkwell::support::LLVMString">LLVMString</a>&gt;</code><a class='srclink' href='../../src/inkwell/context.rs.html#149-164' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new <code>Module</code> for the current <code>Context</code> from a <code>MemoryBuffer</code>.</p>
<h1 id="example-2" class="section-header"><a href="#example-2">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">module</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module</span>(<span class="string">&quot;my_module&quot;</span>);
<span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_builder</span>();
<span class="kw">let</span> <span class="ident">void_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">void_type</span>();
<span class="kw">let</span> <span class="ident">fn_type</span> <span class="op">=</span> <span class="ident">void_type</span>.<span class="ident">fn_type</span>(<span class="kw-2">&amp;</span>[], <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">fn_val</span> <span class="op">=</span> <span class="ident">module</span>.<span class="ident">add_function</span>(<span class="string">&quot;my_fn&quot;</span>, <span class="ident">fn_type</span>, <span class="prelude-val">None</span>);
<span class="kw">let</span> <span class="ident">basic_block</span> <span class="op">=</span> <span class="ident">fn_val</span>.<span class="ident">append_basic_block</span>(<span class="string">&quot;entry&quot;</span>);
<span class="ident">builder</span>.<span class="ident">position_at_end</span>(<span class="kw-2">&amp;</span><span class="ident">basic_block</span>);
<span class="ident">builder</span>.<span class="ident">build_return</span>(<span class="prelude-val">None</span>);
<span class="kw">let</span> <span class="ident">memory_buffer</span> <span class="op">=</span> <span class="ident">module</span>.<span class="ident">write_bitcode_to_memory</span>();
<span class="kw">let</span> <span class="ident">module2</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module_from_ir</span>(<span class="ident">memory_buffer</span>).<span class="ident">unwrap</span>();</pre></div>
</div><h4 id='method.void_type' class="method"><code id='void_type.v'>pub fn <a href='#method.void_type' class='fnname'>void_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.VoidType.html" title="struct inkwell::types::VoidType">VoidType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#178-184' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>VoidType</code>. It will be assigned the current context.</p>
<h1 id="example-3" class="section-header"><a href="#example-3">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">void_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">void_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">void_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.bool_type' class="method"><code id='bool_type.v'>pub fn <a href='#method.bool_type' class='fnname'>bool_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#199-205' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 1 bit width. It will be assigned the current context.</p>
<h1 id="example-4" class="section-header"><a href="#example-4">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">bool_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">bool_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">bool_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">bool_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.i8_type' class="method"><code id='i8_type.v'>pub fn <a href='#method.i8_type' class='fnname'>i8_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#220-226' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 8 bit width. It will be assigned the current context.</p>
<h1 id="example-5" class="section-header"><a href="#example-5">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i8_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i8_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i8_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">8</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i8_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.i16_type' class="method"><code id='i16_type.v'>pub fn <a href='#method.i16_type' class='fnname'>i16_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#241-247' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 16 bit width. It will be assigned the current context.</p>
<h1 id="example-6" class="section-header"><a href="#example-6">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i16_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i16_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i16_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">16</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i16_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.i32_type' class="method"><code id='i32_type.v'>pub fn <a href='#method.i32_type' class='fnname'>i32_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#262-268' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 32 bit width. It will be assigned the current context.</p>
<h1 id="example-7" class="section-header"><a href="#example-7">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i32_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i32_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">32</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i32_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.i64_type' class="method"><code id='i64_type.v'>pub fn <a href='#method.i64_type' class='fnname'>i64_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#283-289' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 64 bit width. It will be assigned the current context.</p>
<h1 id="example-8" class="section-header"><a href="#example-8">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i64_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i64_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i64_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">64</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i64_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.i128_type' class="method"><code id='i128_type.v'>pub fn <a href='#method.i128_type' class='fnname'>i128_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#304-309' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing 128 bit width. It will be assigned the current context.</p>
<h1 id="example-9" class="section-header"><a href="#example-9">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i128_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i128_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i128_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">128</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i128_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.custom_width_int_type' class="method"><code id='custom_width_int_type.v'>pub fn <a href='#method.custom_width_int_type' class='fnname'>custom_width_int_type</a>(&amp;self, bits: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>) -&gt; <a class="struct" href="../../inkwell/types/struct.IntType.html" title="struct inkwell::types::IntType">IntType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#324-330' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>IntType</code> representing a custom bit width. It will be assigned the current context.</p>
<h1 id="example-10" class="section-header"><a href="#example-10">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i42_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">custom_width_int_type</span>(<span class="number">42</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">i42_type</span>.<span class="ident">get_bit_width</span>(), <span class="number">42</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">i42_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.f16_type' class="method"><code id='f16_type.v'>pub fn <a href='#method.f16_type' class='fnname'>f16_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#345-351' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 16 bit width. It will be assigned the current context.</p>
<h1 id="example-11" class="section-header"><a href="#example-11">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f16_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f16_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">f16_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.f32_type' class="method"><code id='f32_type.v'>pub fn <a href='#method.f32_type' class='fnname'>f32_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#366-372' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 32 bit width. It will be assigned the current context.</p>
<h1 id="example-12" class="section-header"><a href="#example-12">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">f32_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.f64_type' class="method"><code id='f64_type.v'>pub fn <a href='#method.f64_type' class='fnname'>f64_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#387-393' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 64 bit width. It will be assigned the current context.</p>
<h1 id="example-13" class="section-header"><a href="#example-13">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f64_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f64_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">f64_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.x86_f80_type' class="method"><code id='x86_f80_type.v'>pub fn <a href='#method.x86_f80_type' class='fnname'>x86_f80_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#408-414' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 80 bit width. It will be assigned the current context.</p>
<h1 id="example-14" class="section-header"><a href="#example-14">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">x86_f80_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">x86_f80_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">x86_f80_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.f128_type' class="method"><code id='f128_type.v'>pub fn <a href='#method.f128_type' class='fnname'>f128_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#429-435' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 128 bit width. It will be assigned the current context.</p>
<h1 id="example-15" class="section-header"><a href="#example-15">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f128_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f128_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">f128_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.ppc_f128_type' class="method"><code id='ppc_f128_type.v'>pub fn <a href='#method.ppc_f128_type' class='fnname'>ppc_f128_type</a>(&amp;self) -&gt; <a class="struct" href="../../inkwell/types/struct.FloatType.html" title="struct inkwell::types::FloatType">FloatType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#452-458' title='goto source code'>[src]</a></h4><div class='docblock'><p>Gets the <code>FloatType</code> representing a 128 bit width. It will be assigned the current context.</p>
<p>PPC is two 64 bits side by side rather than one single 128 bit float.</p>
<h1 id="example-16" class="section-header"><a href="#example-16">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f128_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">ppc_f128_type</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="kw-2">*</span><span class="ident">f128_type</span>.<span class="ident">get_context</span>(), <span class="ident">context</span>);</pre></div>
</div><h4 id='method.struct_type' class="method"><code id='struct_type.v'>pub fn <a href='#method.struct_type' class='fnname'>struct_type</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;field_types: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../inkwell/types/enum.BasicTypeEnum.html" title="enum inkwell::types::BasicTypeEnum">BasicTypeEnum</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;packed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -&gt; <a class="struct" href="../../inkwell/types/struct.StructType.html" title="struct inkwell::types::StructType">StructType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#475-484' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a <code>StructType</code> definiton from heterogeneous types in the current <code>Context</code>.</p>
<h1 id="example-17" class="section-header"><a href="#example-17">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="kw">let</span> <span class="ident">i16_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i16_type</span>();
<span class="kw">let</span> <span class="ident">struct_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">struct_type</span>(<span class="kw-2">&amp;</span>[<span class="ident">i16_type</span>.<span class="ident">into</span>(), <span class="ident">f32_type</span>.<span class="ident">into</span>()], <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">struct_type</span>.<span class="ident">get_field_types</span>(), <span class="kw-2">&amp;</span>[<span class="ident">i16_type</span>.<span class="ident">into</span>(), <span class="ident">f32_type</span>.<span class="ident">into</span>()]);</pre></div>
</div><h4 id='method.opaque_struct_type' class="method"><code id='opaque_struct_type.v'>pub fn <a href='#method.opaque_struct_type' class='fnname'>opaque_struct_type</a>(&amp;self, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../inkwell/types/struct.StructType.html" title="struct inkwell::types::StructType">StructType</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#500-508' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates an opaque <code>StructType</code> with no type definition yet defined.</p>
<h1 id="example-18" class="section-header"><a href="#example-18">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="kw">let</span> <span class="ident">i16_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i16_type</span>();
<span class="kw">let</span> <span class="ident">struct_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">opaque_struct_type</span>(<span class="string">&quot;my_struct&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">struct_type</span>.<span class="ident">get_field_types</span>(), <span class="kw-2">&amp;</span>[]);</pre></div>
</div><h4 id='method.const_struct' class="method"><code id='const_struct.v'>pub fn <a href='#method.const_struct' class='fnname'>const_struct</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;values: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../inkwell/values/enum.BasicValueEnum.html" title="enum inkwell::values::BasicValueEnum">BasicValueEnum</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;packed: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a><br>) -&gt; <a class="struct" href="../../inkwell/values/struct.StructValue.html" title="struct inkwell::values::StructValue">StructValue</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#526-535' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a constant <code>StructValue</code> from constant values.</p>
<h1 id="example-19" class="section-header"><a href="#example-19">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="kw">let</span> <span class="ident">i16_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i16_type</span>();
<span class="kw">let</span> <span class="ident">f32_one</span> <span class="op">=</span> <span class="ident">f32_type</span>.<span class="ident">const_float</span>(<span class="number">1.</span>);
<span class="kw">let</span> <span class="ident">i16_two</span> <span class="op">=</span> <span class="ident">i16_type</span>.<span class="ident">const_int</span>(<span class="number">2</span>, <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">const_struct</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">const_struct</span>(<span class="kw-2">&amp;</span>[<span class="ident">i16_two</span>.<span class="ident">into</span>(), <span class="ident">f32_one</span>.<span class="ident">into</span>()], <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">const_struct</span>.<span class="ident">get_type</span>().<span class="ident">get_field_types</span>(), <span class="kw-2">&amp;</span>[<span class="ident">i16_type</span>.<span class="ident">into</span>(), <span class="ident">f32_type</span>.<span class="ident">into</span>()]);</pre></div>
</div><h4 id='method.append_basic_block' class="method"><code id='append_basic_block.v'>pub fn <a href='#method.append_basic_block' class='fnname'>append_basic_block</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;function: &amp;<a class="struct" href="../../inkwell/values/struct.FunctionValue.html" title="struct inkwell::values::FunctionValue">FunctionValue</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="struct" href="../../inkwell/basic_block/struct.BasicBlock.html" title="struct inkwell::basic_block::BasicBlock">BasicBlock</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#559-567' title='goto source code'>[src]</a></h4><div class='docblock'><p>Append a named <code>BasicBlock</code> at the end of the referenced <code>FunctionValue</code>.</p>
<h1 id="example-20" class="section-header"><a href="#example-20">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">module</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module</span>(<span class="string">&quot;my_mod&quot;</span>);
<span class="kw">let</span> <span class="ident">void_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">void_type</span>();
<span class="kw">let</span> <span class="ident">fn_type</span> <span class="op">=</span> <span class="ident">void_type</span>.<span class="ident">fn_type</span>(<span class="kw-2">&amp;</span>[], <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">fn_value</span> <span class="op">=</span> <span class="ident">module</span>.<span class="ident">add_function</span>(<span class="string">&quot;my_fn&quot;</span>, <span class="ident">fn_type</span>, <span class="prelude-val">None</span>);
<span class="kw">let</span> <span class="ident">entry_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">append_basic_block</span>(<span class="kw-2">&amp;</span><span class="ident">fn_value</span>, <span class="string">&quot;entry&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">1</span>);
<span class="kw">let</span> <span class="ident">last_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">append_basic_block</span>(<span class="kw-2">&amp;</span><span class="ident">fn_value</span>, <span class="string">&quot;last&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_first_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">entry_basic_block</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_last_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">last_basic_block</span>);</pre></div>
</div><h4 id='method.insert_basic_block_after' class="method"><code id='insert_basic_block_after.v'>pub fn <a href='#method.insert_basic_block_after' class='fnname'>insert_basic_block_after</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;basic_block: &amp;<a class="struct" href="../../inkwell/basic_block/struct.BasicBlock.html" title="struct inkwell::basic_block::BasicBlock">BasicBlock</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="struct" href="../../inkwell/basic_block/struct.BasicBlock.html" title="struct inkwell::basic_block::BasicBlock">BasicBlock</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#594-603' title='goto source code'>[src]</a></h4><div class='docblock'><p>Append a named <code>BasicBlock</code> after the referenced <code>BasicBlock</code>.</p>
<h1 id="example-21" class="section-header"><a href="#example-21">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">module</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module</span>(<span class="string">&quot;my_mod&quot;</span>);
<span class="kw">let</span> <span class="ident">void_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">void_type</span>();
<span class="kw">let</span> <span class="ident">fn_type</span> <span class="op">=</span> <span class="ident">void_type</span>.<span class="ident">fn_type</span>(<span class="kw-2">&amp;</span>[], <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">fn_value</span> <span class="op">=</span> <span class="ident">module</span>.<span class="ident">add_function</span>(<span class="string">&quot;my_fn&quot;</span>, <span class="ident">fn_type</span>, <span class="prelude-val">None</span>);
<span class="kw">let</span> <span class="ident">entry_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">append_basic_block</span>(<span class="kw-2">&amp;</span><span class="ident">fn_value</span>, <span class="string">&quot;entry&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">1</span>);
<span class="kw">let</span> <span class="ident">last_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">insert_basic_block_after</span>(<span class="kw-2">&amp;</span><span class="ident">entry_basic_block</span>, <span class="string">&quot;last&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_first_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">entry_basic_block</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_last_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">last_basic_block</span>);</pre></div>
</div><h4 id='method.prepend_basic_block' class="method"><code id='prepend_basic_block.v'>pub fn <a href='#method.prepend_basic_block' class='fnname'>prepend_basic_block</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;basic_block: &amp;<a class="struct" href="../../inkwell/basic_block/struct.BasicBlock.html" title="struct inkwell::basic_block::BasicBlock">BasicBlock</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>) -&gt; <a class="struct" href="../../inkwell/basic_block/struct.BasicBlock.html" title="struct inkwell::basic_block::BasicBlock">BasicBlock</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#627-635' title='goto source code'>[src]</a></h4><div class='docblock'><p>Prepend a named <code>BasicBlock</code> before the referenced <code>BasicBlock</code>.</p>
<h1 id="example-22" class="section-header"><a href="#example-22">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">module</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_module</span>(<span class="string">&quot;my_mod&quot;</span>);
<span class="kw">let</span> <span class="ident">void_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">void_type</span>();
<span class="kw">let</span> <span class="ident">fn_type</span> <span class="op">=</span> <span class="ident">void_type</span>.<span class="ident">fn_type</span>(<span class="kw-2">&amp;</span>[], <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">fn_value</span> <span class="op">=</span> <span class="ident">module</span>.<span class="ident">add_function</span>(<span class="string">&quot;my_fn&quot;</span>, <span class="ident">fn_type</span>, <span class="prelude-val">None</span>);
<span class="kw">let</span> <span class="ident">entry_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">append_basic_block</span>(<span class="kw-2">&amp;</span><span class="ident">fn_value</span>, <span class="string">&quot;entry&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">1</span>);
<span class="kw">let</span> <span class="ident">first_basic_block</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">prepend_basic_block</span>(<span class="kw-2">&amp;</span><span class="ident">entry_basic_block</span>, <span class="string">&quot;first&quot;</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">count_basic_blocks</span>(), <span class="number">2</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_first_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">first_basic_block</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">fn_value</span>.<span class="ident">get_last_basic_block</span>().<span class="ident">unwrap</span>(), <span class="ident">entry_basic_block</span>);</pre></div>
</div><h4 id='method.metadata_node' class="method"><code id='metadata_node.v'>pub fn <a href='#method.metadata_node' class='fnname'>metadata_node</a>(&amp;self, values: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="enum" href="../../inkwell/values/enum.BasicValueEnum.html" title="enum inkwell::values::BasicValueEnum">BasicValueEnum</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="struct" href="../../inkwell/values/struct.MetadataValue.html" title="struct inkwell::values::MetadataValue">MetadataValue</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#659-668' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a <code>MetadataValue</code> tuple of heterogeneous types (a &quot;Node&quot;) for the current context. It can be assigned to a value.</p>
<h1 id="example-23" class="section-header"><a href="#example-23">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">i8_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">i8_type</span>();
<span class="kw">let</span> <span class="ident">i8_two</span> <span class="op">=</span> <span class="ident">i8_type</span>.<span class="ident">const_int</span>(<span class="number">2</span>, <span class="bool-val">false</span>);
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="kw">let</span> <span class="ident">f32_zero</span> <span class="op">=</span> <span class="ident">f32_type</span>.<span class="ident">const_float</span>(<span class="number">0.</span>);
<span class="kw">let</span> <span class="ident">md_node</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">metadata_node</span>(<span class="kw-2">&amp;</span>[<span class="ident">i8_two</span>.<span class="ident">into</span>(), <span class="ident">f32_zero</span>.<span class="ident">into</span>()]);
<span class="kw">let</span> <span class="ident">f32_one</span> <span class="op">=</span> <span class="ident">f32_type</span>.<span class="ident">const_float</span>(<span class="number">1.</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">md_node</span>.<span class="ident">is_node</span>());
<span class="ident">f32_one</span>.<span class="ident">set_metadata</span>(<span class="ident">md_node</span>, <span class="number">0</span>);</pre></div>
</div><h4 id='method.metadata_string' class="method"><code id='metadata_string.v'>pub fn <a href='#method.metadata_string' class='fnname'>metadata_string</a>(&amp;self, string: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../inkwell/values/struct.MetadataValue.html" title="struct inkwell::values::MetadataValue">MetadataValue</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#687-695' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a <code>MetadataValue</code> string for the current context. It can be assigned to a value.</p>
<h1 id="example-24" class="section-header"><a href="#example-24">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">md_string</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">metadata_string</span>(<span class="string">&quot;Floats are awesome!&quot;</span>);
<span class="kw">let</span> <span class="ident">f32_type</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">f32_type</span>();
<span class="kw">let</span> <span class="ident">f32_one</span> <span class="op">=</span> <span class="ident">f32_type</span>.<span class="ident">const_float</span>(<span class="number">1.</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">md_string</span>.<span class="ident">is_string</span>());
<span class="ident">f32_one</span>.<span class="ident">set_metadata</span>(<span class="ident">md_string</span>, <span class="number">0</span>);</pre></div>
</div><h4 id='method.get_kind_id' class="method"><code id='get_kind_id.v'>pub fn <a href='#method.get_kind_id' class='fnname'>get_kind_id</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#714-718' title='goto source code'>[src]</a></h4><div class='docblock'><p>Obtains the index of a metadata kind id. If the string doesn't exist, LLVM will add it at index <code>FIRST_CUSTOM_METADATA_KIND_ID</code> onward.</p>
<h1 id="example-25" class="section-header"><a href="#example-25">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">values</span>::<span class="ident">FIRST_CUSTOM_METADATA_KIND_ID</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">context</span>.<span class="ident">get_kind_id</span>(<span class="string">&quot;dbg&quot;</span>), <span class="number">0</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">context</span>.<span class="ident">get_kind_id</span>(<span class="string">&quot;tbaa&quot;</span>), <span class="number">1</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">context</span>.<span class="ident">get_kind_id</span>(<span class="string">&quot;prof&quot;</span>), <span class="number">2</span>);
<span class="comment">// Custom kind id doesn&#39;t exist in LLVM until now:</span>
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">context</span>.<span class="ident">get_kind_id</span>(<span class="string">&quot;foo&quot;</span>), <span class="ident">FIRST_CUSTOM_METADATA_KIND_ID</span>);</pre></div>
</div><h4 id='method.create_enum_attribute' class="method"><code id='create_enum_attribute.v'>pub fn <a href='#method.create_enum_attribute' class='fnname'>create_enum_attribute</a>(&amp;self, kind_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>, val: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -&gt; <a class="struct" href="../../inkwell/attributes/struct.Attribute.html" title="struct inkwell::attributes::Attribute">Attribute</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#744-750' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates an enum <code>Attribute</code> in this <code>Context</code>.</p>
<h1 id="example-26" class="section-header"><a href="#example-26">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">enum_attribute</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_enum_attribute</span>(<span class="number">0</span>, <span class="number">10</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">enum_attribute</span>.<span class="ident">is_enum</span>());</pre></div>
</div><h4 id='method.create_string_attribute' class="method"><code id='create_string_attribute.v'>pub fn <a href='#method.create_string_attribute' class='fnname'>create_string_attribute</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, val: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../../inkwell/attributes/struct.Attribute.html" title="struct inkwell::attributes::Attribute">Attribute</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#765-771' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a string <code>Attribute</code> in this <code>Context</code>.</p>
<h1 id="example-27" class="section-header"><a href="#example-27">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">string_attribute</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">create_string_attribute</span>(<span class="string">&quot;my_key_123&quot;</span>, <span class="string">&quot;my_val&quot;</span>);
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">string_attribute</span>.<span class="ident">is_string</span>());</pre></div>
</div><h4 id='method.const_string' class="method"><code id='const_string.v'>pub fn <a href='#method.const_string' class='fnname'>const_string</a>(&amp;self, string: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, null_terminated: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -&gt; <a class="struct" href="../../inkwell/values/struct.VectorValue.html" title="struct inkwell::values::VectorValue">VectorValue</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#786-792' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a const string which may be null terminated.</p>
<h1 id="example-28" class="section-header"><a href="#example-28">Example</a></h1>
<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">inkwell</span>::<span class="ident">context</span>::<span class="ident">Context</span>;
<span class="kw">let</span> <span class="ident">context</span> <span class="op">=</span> <span class="ident">Context</span>::<span class="ident">create</span>();
<span class="kw">let</span> <span class="ident">string</span> <span class="op">=</span> <span class="ident">context</span>.<span class="ident">const_string</span>(<span class="string">&quot;my_string&quot;</span>, <span class="bool-val">false</span>);
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">string</span>.<span class="ident">print_to_string</span>().<span class="ident">to_string</span>(), <span class="string">&quot;[9 x i8] c\&quot;my_string\&quot;&quot;</span>);</pre></div>
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Eq' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html" title="trait core::cmp::Eq">Eq</a> for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Eq' class='anchor'></a><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-Drop' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Drop' class='anchor'></a><a class='srclink' href='../../src/inkwell/context.rs.html#841-846' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.drop' class="method hidden"><code id='drop.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code><a class='srclink' href='../../src/inkwell/context.rs.html#842-845' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Executes the destructor for this type. <a href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3 id='impl-PartialEq%3CContextRef%3E' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a>&lt;<a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a>&gt; for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-PartialEq%3CContextRef%3E' class='anchor'></a><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.eq' class="method hidden"><code id='eq.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, other: &amp;<a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class="method hidden"><code id='ne.v'>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;<a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 id='impl-Deref' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Deref' class='anchor'></a><a class='srclink' href='../../src/inkwell/context.rs.html#833-839' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><code id='Target.t'>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="../../inkwell/context/struct.Context.html" title="struct inkwell::context::Context">Context</a></code></h4><div class='docblock'><p>The resulting type after dereferencing.</p>
</div><h4 id='method.deref' class="method hidden"><code id='deref.v'>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&amp;self) -&gt; &amp;Self::<a class="type" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" title="type core::ops::deref::Deref::Target">Target</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#836-838' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Dereferences the value.</p>
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <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="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/inkwell/context.rs.html#820' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>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></p>
</div></div></div><h2 id='synthetic-implementations' class='small-section-header'>Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a></h2><div id='synthetic-implementations-list'><h3 id='impl-Sync' class='impl'><code class='in-band'>impl !<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="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Send' class='impl'><code class='in-band'>impl !<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="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Unpin' class='impl'><code class='in-band'>impl <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="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-Unpin' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-UnwindSafe' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-UnwindSafe' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-RefUnwindSafe' class='impl'><code class='in-band'>impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../inkwell/context/struct.ContextRef.html" title="struct inkwell::context::ContextRef">ContextRef</a></code><a href='#impl-RefUnwindSafe' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Into%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-Into%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#543-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -&gt; U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#545-547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-From%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</code><a href='#impl-From%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -&gt; T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryFrom%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryFrom%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error' class="type"><code id='Error.t'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error' class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_from' class="method hidden"><code id='try_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from' class='fnname'>try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-TryInto%3CU%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></code><a href='#impl-TryInto%3CU%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Error-1' class="type"><code id='Error.t-1'>type <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error' class="type">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4 id='method.try_into' class="method hidden"><code id='try_into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into' class='fnname'>try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3 id='impl-BorrowMut%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-BorrowMut%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow_mut' class="method hidden"><code id='borrow_mut.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut' class='fnname'>borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>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></p>
</div></div><h3 id='impl-Borrow%3CT%3E' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Borrow%3CT%3E' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.borrow' class="method hidden"><code id='borrow.v'>fn <a href='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow' class='fnname'>borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3 id='impl-Any' class='impl'><code class='in-band'>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-Any' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.type_id' class="method hidden"><code id='type_id.v'>fn <a href='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id' class='fnname'>type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>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></p>
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "inkwell";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>