mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-24 10:26:25 +04:00
deploy: 40b5370f6b
This commit is contained in:
parent
c433d5df71
commit
d84306f7a1
7
ch6/bare_metal/all.html
Normal file
7
ch6/bare_metal/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate bare_metal</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bare_metal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.CriticalSection.html">CriticalSection</a></li><li><a href="struct.Mutex.html">Mutex</a></li><li><a href="struct.Peripheral.html">Peripheral</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.Nr.html">Nr</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bare_metal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
15
ch6/bare_metal/index.html
Normal file
15
ch6/bare_metal/index.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!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="Abstractions common to bare metal systems"><meta name="keywords" content="rust, rustlang, rust-lang, bare_metal"><title>bare_metal - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate bare_metal</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.2.5</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="bare_metal" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bare_metal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">bare_metal</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bare_metal/lib.rs.html#1-101">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Abstractions common to bare metal systems</p>
|
||||
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.CriticalSection.html" title="bare_metal::CriticalSection struct">CriticalSection</a></div><div class="item-right docblock-short"><p>Critical section token</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Mutex.html" title="bare_metal::Mutex struct">Mutex</a></div><div class="item-right docblock-short"><p>A “mutex” based on critical sections</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Peripheral.html" title="bare_metal::Peripheral struct">Peripheral</a></div><div class="item-right docblock-short"><p>A peripheral</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Nr.html" title="bare_metal::Nr trait">Nr</a></div><div class="item-right docblock-short"><p>Interrupt number</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bare_metal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/bare_metal/sidebar-items.js
Normal file
1
ch6/bare_metal/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"struct":[["CriticalSection","Critical section token"],["Mutex","A “mutex” based on critical sections"],["Peripheral","A peripheral"]],"trait":[["Nr","Interrupt number"]]});
|
24
ch6/bare_metal/struct.CriticalSection.html
Normal file
24
ch6/bare_metal/struct.CriticalSection.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!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="Critical section token"><meta name="keywords" content="rust, rustlang, rust-lang, CriticalSection"><title>CriticalSection in bare_metal - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">CriticalSection</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In bare_metal</a></h2><div id="sidebar-vars" data-name="CriticalSection" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bare_metal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">bare_metal</a>::<wbr><a class="struct" href="#">CriticalSection</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bare_metal/lib.rs.html#42-44">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct CriticalSection { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Critical section token</p>
|
||||
<p>Indicates that you are executing code within a critical section</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#46-54">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#51-53">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.new" class="fnname">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Creates a critical section token</p>
|
||||
<p>This method is meant to be used to create safe abstractions rather than
|
||||
meant to be directly used in applications.</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bare_metal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
25
ch6/bare_metal/struct.Mutex.html
Normal file
25
ch6/bare_metal/struct.Mutex.html
Normal file
File diff suppressed because one or more lines are too long
25
ch6/bare_metal/struct.Peripheral.html
Normal file
25
ch6/bare_metal/struct.Peripheral.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!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 peripheral"><meta name="keywords" content="rust, rustlang, rust-lang, Peripheral"><title>Peripheral in bare_metal - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Peripheral</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.borrow">borrow</a></li><li><a href="#method.get">get</a></li><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Debug">Debug</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">!Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In bare_metal</a></h2><div id="sidebar-vars" data-name="Peripheral" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bare_metal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">bare_metal</a>::<wbr><a class="struct" href="#">Peripheral</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bare_metal/lib.rs.html#11-16">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct Peripheral<T> <span class="where fmt-newline">where<br> T: 'static, </span> { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A peripheral</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#18-37">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="struct" href="struct.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#22-26">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub const unsafe fn <a href="#method.new" class="fnname">new</a>(address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> Self</h4></section></summary><div class="docblock"><p>Creates a new peripheral</p>
|
||||
<p><code>address</code> is the base address of the register block</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#29-31">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.borrow" class="fnname">borrow</a><'cs>(&self, _ctxt: &'cs <a class="struct" href="struct.CriticalSection.html" title="struct bare_metal::CriticalSection">CriticalSection</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'cs </a>T</h4></section></summary><div class="docblock"><p>Borrows the peripheral for the duration of a critical section</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#34-36">source</a></span><a href="#method.get" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get" class="fnname">get</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut T</a></h4></section></summary><div class="docblock"><p>Returns a pointer to the register block</p>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#10">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header in-band">impl<T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T> <span class="where fmt-newline">where<br> T: 'static, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#10">source</a></span><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="fnname">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'><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></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl<T> <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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T> <span class="where fmt-newline">where<br> T: <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>, </span></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl<T> !<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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl<T> !<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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl<T> <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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl<T> <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.Peripheral.html" title="struct bare_metal::Peripheral">Peripheral</a><T> <span class="where fmt-newline">where<br> T: <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>, </span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow-1" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><a href="#method.borrow-1" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bare_metal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
12
ch6/bare_metal/trait.Nr.html
Normal file
12
ch6/bare_metal/trait.Nr.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!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="Interrupt number"><meta name="keywords" content="rust, rustlang, rust-lang, Nr"><title>Nr in bare_metal - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bare_metal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Nr</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.nr">nr</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In bare_metal</a></h2><div id="sidebar-vars" data-name="Nr" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bare_metal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="index.html">bare_metal</a>::<wbr><a class="trait" href="#">Nr</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bare_metal/lib.rs.html#93-96">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub unsafe trait Nr {
|
||||
fn <a href="#tymethod.nr" class="fnname">nr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Interrupt number</p>
|
||||
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.nr" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bare_metal/lib.rs.html#95">source</a></div><h4 class="code-header">fn <a href="#tymethod.nr" class="fnname">nr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></div></summary><div class="docblock"><p>Returns the number associated with an interrupt</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/bare_metal/trait.Nr.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bare_metal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
7
ch6/bit_field/all.html
Normal file
7
ch6/bit_field/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate bit_field</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bit_field/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.BitArray.html">BitArray</a></li><li><a href="trait.BitField.html">BitField</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bit_field" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
13
ch6/bit_field/index.html
Normal file
13
ch6/bit_field/index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!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="Provides the abstraction of a bit field, which allows for bit-level update and retrieval operations."><meta name="keywords" content="rust, rustlang, rust-lang, bit_field"><title>bit_field - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate bit_field</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.10.1</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="bit_field" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bit_field/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">bit_field</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bit_field/lib.rs.html#1-366">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides the abstraction of a bit field, which allows for bit-level update and retrieval
|
||||
operations.</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.BitArray.html" title="bit_field::BitArray trait">BitArray</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.BitField.html" title="bit_field::BitField trait">BitField</a></div><div class="item-right docblock-short"><p>A generic trait which provides methods for extracting and setting specific bits or ranges of
|
||||
bits.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bit_field" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/bit_field/sidebar-items.js
Normal file
1
ch6/bit_field/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["BitArray",""],["BitField","A generic trait which provides methods for extracting and setting specific bits or ranges of bits."]]});
|
81
ch6/bit_field/trait.BitArray.html
Normal file
81
ch6/bit_field/trait.BitArray.html
Normal file
@ -0,0 +1,81 @@
|
||||
<!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 `BitArray` trait in crate `bit_field`."><meta name="keywords" content="rust, rustlang, rust-lang, BitArray"><title>BitArray in bit_field - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bit_field/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">BitArray</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.bit_length">bit_length</a></li><li><a href="#tymethod.get_bit">get_bit</a></li><li><a href="#tymethod.get_bits">get_bits</a></li><li><a href="#tymethod.set_bit">set_bit</a></li><li><a href="#tymethod.set_bits">set_bits</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-BitArray%3CT%3E-for-%5BT%5D">[T]</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In bit_field</a></h2><div id="sidebar-vars" data-name="BitArray" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bit_field/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="index.html">bit_field</a>::<wbr><a class="trait" href="#">BitArray</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bit_field/lib.rs.html#111-206">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait BitArray<T: <a class="trait" href="trait.BitField.html" title="trait bit_field::BitField">BitField</a>> {
|
||||
fn <a href="#tymethod.bit_length" class="fnname">bit_length</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.get_bit" class="fnname">get_bit</a>(&self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.get_bits" class="fnname">get_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&self, range: U) -> T;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.set_bit" class="fnname">set_bit</a>(&mut self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>);
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.set_bits" class="fnname">set_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&mut self, range: U, value: T);
|
||||
}</code></pre></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.bit_length" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#120">source</a></div><h4 class="code-header">fn <a href="#tymethod.bit_length" class="fnname">bit_length</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></div></summary><div class="docblock"><p>Returns the length, eg number of bits, in this bit array.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bit_field::BitArray</span>;
|
||||
|
||||
<span class="macro">assert_eq!</span>([<span class="number">0u8</span>, <span class="number">4u8</span>, <span class="number">8u8</span>].<span class="ident">bit_length</span>(), <span class="number">24</span>);
|
||||
<span class="macro">assert_eq!</span>([<span class="number">0u32</span>, <span class="number">5u32</span>].<span class="ident">bit_length</span>(), <span class="number">64</span>);</code></pre></div>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.get_bit" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#137">source</a></div><h4 class="code-header">fn <a href="#tymethod.get_bit" class="fnname">get_bit</a>(&self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div></summary><div class="docblock"><p>Obtains the bit at the index <code>bit</code>; note that index 0 is the least significant bit, while
|
||||
index <code>length() - 1</code> is the most significant bit.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bit_field::BitArray</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">value</span>: [<span class="ident">u32</span>; <span class="number">1</span>] <span class="op">=</span> [<span class="number">0b110101</span>];
|
||||
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bit</span>(<span class="number">1</span>), <span class="bool-val">false</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bit</span>(<span class="number">2</span>), <span class="bool-val">true</span>);</code></pre></div>
|
||||
<h6 id="panics"><a href="#panics">Panics</a></h6>
|
||||
<p>This method will panic if the bit index is out of bounds of the bit array.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.get_bits" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#158">source</a></div><h4 class="code-header">fn <a href="#tymethod.get_bits" class="fnname">get_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&self, range: U) -> T</h4></div></summary><div class="docblock"><p>Obtains the range of bits specified by <code>range</code>; note that index 0 is the least significant
|
||||
bit, while index <code>length() - 1</code> is the most significant bit.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bit_field::BitArray</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">value</span>: [<span class="ident">u32</span>; <span class="number">2</span>] <span class="op">=</span> [<span class="number">0b110101</span>, <span class="number">0b11</span>];
|
||||
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bits</span>(<span class="number">0</span>..<span class="number">3</span>), <span class="number">0b101</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bits</span>(..<span class="number">6</span>), <span class="number">0b110101</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bits</span>(<span class="number">31</span>..<span class="number">33</span>), <span class="number">0b10</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bits</span>(<span class="number">5</span>..<span class="op">=</span><span class="number">32</span>), <span class="number">0b1_0000_0000_0000_0000_0000_0000_001</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>.<span class="ident">get_bits</span>(<span class="number">34</span>..), <span class="number">0</span>);</code></pre></div>
|
||||
<h6 id="panics-1"><a href="#panics-1">Panics</a></h6>
|
||||
<p>This method will panic if the start or end indexes of the range are out of bounds of the
|
||||
bit array, or if the range can’t be contained by the bit field T.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.set_bit" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#182">source</a></div><h4 class="code-header">fn <a href="#tymethod.set_bit" class="fnname">set_bit</a>(&mut self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>)</h4></div></summary><div class="docblock"><p>Sets the bit at the index <code>bit</code> to the value <code>value</code> (where true means a value of ‘1’ and
|
||||
false means a value of ‘0’); note that index 0 is the least significant bit, while index
|
||||
<code>length() - 1</code> is the most significant bit.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bit_field::BitArray</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value</span> <span class="op">=</span> [<span class="number">0u32</span>];
|
||||
|
||||
<span class="ident">value</span>.<span class="ident">set_bit</span>(<span class="number">1</span>, <span class="bool-val">true</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>, [<span class="number">2u32</span>]);
|
||||
|
||||
<span class="ident">value</span>.<span class="ident">set_bit</span>(<span class="number">3</span>, <span class="bool-val">true</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>, [<span class="number">10u32</span>]);
|
||||
|
||||
<span class="ident">value</span>.<span class="ident">set_bit</span>(<span class="number">1</span>, <span class="bool-val">false</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>, [<span class="number">8u32</span>]);</code></pre></div>
|
||||
<h6 id="panics-2"><a href="#panics-2">Panics</a></h6>
|
||||
<p>This method will panic if the bit index is out of the bounds of the bit array.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.set_bits" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#205">source</a></div><h4 class="code-header">fn <a href="#tymethod.set_bits" class="fnname">set_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&mut self, range: U, value: T)</h4></div></summary><div class="docblock"><p>Sets the range of bits defined by the range <code>range</code> to the lower bits of <code>value</code>; to be
|
||||
specific, if the range is N bits long, the N lower bits of <code>value</code> will be used; if any of
|
||||
the other bits in <code>value</code> are set to 1, this function will panic.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bit_field::BitArray</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value</span> <span class="op">=</span> [<span class="number">0u32</span>, <span class="number">0u32</span>];
|
||||
|
||||
<span class="ident">value</span>.<span class="ident">set_bits</span>(<span class="number">0</span>..<span class="number">2</span>, <span class="number">0b11</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>, [<span class="number">0b11</span>, <span class="number">0u32</span>]);
|
||||
|
||||
<span class="ident">value</span>.<span class="ident">set_bits</span>(<span class="number">31</span>..<span class="number">35</span>, <span class="number">0b1010</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">value</span>, [<span class="number">0x0003</span>, <span class="number">0b101</span>]);</code></pre></div>
|
||||
<h6 id="panics-3"><a href="#panics-3">Panics</a></h6>
|
||||
<p>This method will panic if the range is out of bounds of the bit array,
|
||||
if the range can’t be contained by the bit field T, or if there are <code>1</code>s
|
||||
not in the lower N bits of <code>value</code>.</p>
|
||||
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BitArray%3CT%3E-for-%5BT%5D" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#275-351">source</a></span><a href="#impl-BitArray%3CT%3E-for-%5BT%5D" class="anchor"></a><h3 class="code-header in-band">impl<T: <a class="trait" href="trait.BitField.html" title="trait bit_field::BitField">BitField</a>> <a class="trait" href="trait.BitArray.html" title="trait bit_field::BitArray">BitArray</a><T> for <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">[</a>T<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a></h3></section></summary><div class="impl-items"><section id="method.bit_length" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#277-279">source</a></span><a href="#method.bit_length" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.bit_length" class="fnname">bit_length</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section><section id="method.get_bit" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#282-286">source</a></span><a href="#method.get_bit" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.get_bit" class="fnname">get_bit</a>(&self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section><section id="method.get_bits" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#289-314">source</a></span><a href="#method.get_bits" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.get_bits" class="fnname">get_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&self, range: U) -> T</h4></section><section id="method.set_bit" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#317-321">source</a></span><a href="#method.set_bit" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.set_bit" class="fnname">set_bit</a>(&mut self, bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, value: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>)</h4></section><section id="method.set_bits" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/bit_field/lib.rs.html#324-350">source</a></span><a href="#method.set_bits" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.set_bits" class="fnname">set_bits</a><U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/range/trait.RangeBounds.html" title="trait core::ops::range::RangeBounds">RangeBounds</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>>(&mut self, range: U, value: T)</h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/bit_field/trait.BitArray.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bit_field" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
85
ch6/bit_field/trait.BitField.html
Normal file
85
ch6/bit_field/trait.BitField.html
Normal file
File diff suppressed because one or more lines are too long
7
ch6/bitflags/all.html
Normal file
7
ch6/bitflags/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate bitflags</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.bitflags.html">bitflags</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
237
ch6/bitflags/index.html
Normal file
237
ch6/bitflags/index.html
Normal file
@ -0,0 +1,237 @@
|
||||
<!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 typesafe bitmask flag generator useful for sets of C-style bitmask flags. It can be used for creating typesafe wrappers around C APIs."><meta name="keywords" content="rust, rustlang, rust-lang, bitflags"><title>bitflags - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate bitflags</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 1.3.2</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#macros">Macros</a></li></ul></div></section><div id="sidebar-vars" data-name="bitflags" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">bitflags</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bitflags/lib.rs.html#11-1729">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A typesafe bitmask flag generator useful for sets of C-style bitmask flags.
|
||||
It can be used for creating typesafe wrappers around C APIs.</p>
|
||||
<p>The <code>bitflags!</code> macro generates <code>struct</code>s that manage a set of flags. The
|
||||
flags should only be defined for integer types, otherwise unexpected type
|
||||
errors may occur at compile time.</p>
|
||||
<h2 id="example"><a href="#example">Example</a></h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
|
||||
<span class="kw">const</span> <span class="ident">ABC</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::A</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::B</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::C</span>.<span class="ident">bits</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">e1</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
|
||||
<span class="kw">let</span> <span class="ident">e2</span> <span class="op">=</span> <span class="ident">Flags::B</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">|</span> <span class="ident">e2</span>), <span class="ident">Flags::ABC</span>); <span class="comment">// union</span>
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">&</span> <span class="ident">e2</span>), <span class="ident">Flags::C</span>); <span class="comment">// intersection</span>
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">-</span> <span class="ident">e2</span>), <span class="ident">Flags::A</span>); <span class="comment">// set difference</span>
|
||||
<span class="macro">assert_eq!</span>(<span class="op">!</span><span class="ident">e2</span>, <span class="ident">Flags::A</span>); <span class="comment">// set complement</span>
|
||||
}</code></pre></div>
|
||||
<p>See <a href="./example_generated/struct.Flags.html"><code>example_generated::Flags</code></a> for documentation of code
|
||||
generated by the above <code>bitflags!</code> expansion.</p>
|
||||
<p>The generated <code>struct</code>s can also be extended with type and trait
|
||||
implementations:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Flags</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) {
|
||||
<span class="self">self</span>.<span class="ident">bits</span> <span class="op">=</span> <span class="number">0</span>; <span class="comment">// The `bits` field can be accessed from within the</span>
|
||||
<span class="comment">// same module where the `bitflags!` macro was invoked.</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">fmt::Display</span> <span class="kw">for</span> <span class="ident">Flags</span> {
|
||||
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&mut</span> <span class="ident">fmt::Formatter</span>) -> <span class="ident">fmt::Result</span> {
|
||||
<span class="macro">write!</span>(<span class="ident">f</span>, <span class="string">"hi!"</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">flags</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>;
|
||||
<span class="ident">flags</span>.<span class="ident">clear</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">flags</span>.<span class="ident">is_empty</span>());
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">flags</span>), <span class="string">"hi!"</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{:?}"</span>, <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>), <span class="string">"A | B"</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{:?}"</span>, <span class="ident">Flags::B</span>), <span class="string">"B"</span>);
|
||||
}</code></pre></div>
|
||||
<h2 id="visibility"><a href="#visibility">Visibility</a></h2>
|
||||
<p>The generated structs and their associated flag constants are not exported
|
||||
out of the current module by default. A definition can be exported out of
|
||||
the current module by adding <code>pub</code> before <code>struct</code>:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">mod</span> <span class="ident">example</span> {
|
||||
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Flags1</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
}
|
||||
|
||||
<span class="kw">struct</span> <span class="ident">Flags2</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">flag1</span> <span class="op">=</span> <span class="ident">example::Flags1::A</span>;
|
||||
<span class="kw">let</span> <span class="ident">flag2</span> <span class="op">=</span> <span class="ident">example::Flags2::B</span>; <span class="comment">// error: const `B` is private</span>
|
||||
}</code></pre></div>
|
||||
<h2 id="attributes"><a href="#attributes">Attributes</a></h2>
|
||||
<p>Attributes can be attached to the generated <code>struct</code>s by placing them
|
||||
before the <code>struct</code> keyword.</p>
|
||||
<h3 id="representations"><a href="#representations">Representations</a></h3>
|
||||
<p>It’s valid to add a <code>#[repr(C)]</code> or <code>#[repr(transparent)]</code> attribute to a type
|
||||
generated by <code>bitflags!</code>. In these cases, the type is guaranteed to be a newtype.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="attribute">#[<span class="ident">repr</span>(<span class="ident">transparent</span>)]</span>
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
|
||||
}
|
||||
}</code></pre></div>
|
||||
<h2 id="trait-implementations-1"><a href="#trait-implementations-1">Trait implementations</a></h2>
|
||||
<p>The <code>Copy</code>, <code>Clone</code>, <code>PartialEq</code>, <code>Eq</code>, <code>PartialOrd</code>, <code>Ord</code> and <code>Hash</code>
|
||||
traits are automatically derived for the <code>struct</code>s using the <code>derive</code> attribute.
|
||||
Additional traits can be derived by providing an explicit <code>derive</code>
|
||||
attribute on <code>struct</code>.</p>
|
||||
<p>The <code>Extend</code> and <code>FromIterator</code> traits are implemented for the <code>struct</code>s,
|
||||
too: <code>Extend</code> adds the union of the instances of the <code>struct</code> iterated over,
|
||||
while <code>FromIterator</code> calculates the union.</p>
|
||||
<p>The <code>Binary</code>, <code>Debug</code>, <code>LowerHex</code>, <code>Octal</code> and <code>UpperHex</code> traits are also
|
||||
implemented by displaying the bits value of the internal struct.</p>
|
||||
<h3 id="operators"><a href="#operators">Operators</a></h3>
|
||||
<p>The following operator traits are implemented for the generated <code>struct</code>s:</p>
|
||||
<ul>
|
||||
<li><code>BitOr</code> and <code>BitOrAssign</code>: union</li>
|
||||
<li><code>BitAnd</code> and <code>BitAndAssign</code>: intersection</li>
|
||||
<li><code>BitXor</code> and <code>BitXorAssign</code>: toggle</li>
|
||||
<li><code>Sub</code> and <code>SubAssign</code>: set difference</li>
|
||||
<li><code>Not</code>: set complement</li>
|
||||
</ul>
|
||||
<h2 id="methods"><a href="#methods">Methods</a></h2>
|
||||
<p>The following methods are defined for the generated <code>struct</code>s:</p>
|
||||
<ul>
|
||||
<li><code>empty</code>: an empty set of flags</li>
|
||||
<li><code>all</code>: the set of all defined flags</li>
|
||||
<li><code>bits</code>: the raw value of the flags currently stored</li>
|
||||
<li><code>from_bits</code>: convert from underlying bit representation, unless that
|
||||
representation contains bits that do not correspond to a
|
||||
defined flag</li>
|
||||
<li><code>from_bits_truncate</code>: convert from underlying bit representation, dropping
|
||||
any bits that do not correspond to defined flags</li>
|
||||
<li><code>from_bits_unchecked</code>: convert from underlying bit representation, keeping
|
||||
all bits (even those not corresponding to defined
|
||||
flags)</li>
|
||||
<li><code>is_empty</code>: <code>true</code> if no flags are currently stored</li>
|
||||
<li><code>is_all</code>: <code>true</code> if currently set flags exactly equal all defined flags</li>
|
||||
<li><code>intersects</code>: <code>true</code> if there are flags common to both <code>self</code> and <code>other</code></li>
|
||||
<li><code>contains</code>: <code>true</code> if all of the flags in <code>other</code> are contained within <code>self</code></li>
|
||||
<li><code>insert</code>: inserts the specified flags in-place</li>
|
||||
<li><code>remove</code>: removes the specified flags in-place</li>
|
||||
<li><code>toggle</code>: the specified flags will be inserted if not present, and removed
|
||||
if they are.</li>
|
||||
<li><code>set</code>: inserts or removes the specified flags depending on the passed value</li>
|
||||
<li><code>intersection</code>: returns a new set of flags, containing only the flags present
|
||||
in both <code>self</code> and <code>other</code> (the argument to the function).</li>
|
||||
<li><code>union</code>: returns a new set of flags, containing any flags present in
|
||||
either <code>self</code> or <code>other</code> (the argument to the function).</li>
|
||||
<li><code>difference</code>: returns a new set of flags, containing all flags present in
|
||||
<code>self</code> without any of the flags present in <code>other</code> (the
|
||||
argument to the function).</li>
|
||||
<li><code>symmetric_difference</code>: returns a new set of flags, containing all flags
|
||||
present in either <code>self</code> or <code>other</code> (the argument
|
||||
to the function), but not both.</li>
|
||||
<li><code>complement</code>: returns a new set of flags, containing all flags which are
|
||||
not set in <code>self</code>, but which are allowed for this type.</li>
|
||||
</ul>
|
||||
<h3 id="default"><a href="#default">Default</a></h3>
|
||||
<p>The <code>Default</code> trait is not automatically implemented for the generated structs.</p>
|
||||
<p>If your default value is equal to <code>0</code> (which is the same value as calling <code>empty()</code>
|
||||
on the generated struct), you can simply derive <code>Default</code>:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="comment">// Results in default value with bits: 0</span>
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>)]</span>
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">derived_default</span>: <span class="ident">Flags</span> <span class="op">=</span> <span class="ident">Default::default</span>();
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">derived_default</span>.<span class="ident">bits</span>(), <span class="number">0</span>);
|
||||
}</code></pre></div>
|
||||
<p>If your default value is not equal to <code>0</code> you need to implement <code>Default</code> yourself:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// explicit `Default` implementation</span>
|
||||
<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">Flags</span> {
|
||||
<span class="kw">fn</span> <span class="ident">default</span>() -> <span class="ident">Flags</span> {
|
||||
<span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">implemented_default</span>: <span class="ident">Flags</span> <span class="op">=</span> <span class="ident">Default::default</span>();
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">implemented_default</span>, (<span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>));
|
||||
}</code></pre></div>
|
||||
<h2 id="zero-flags"><a href="#zero-flags">Zero Flags</a></h2>
|
||||
<p>Flags with a value equal to zero will have some strange behavior that one should be aware of.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">NONE</span> <span class="op">=</span> <span class="number">0b00000000</span>;
|
||||
<span class="kw">const</span> <span class="ident">SOME</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">empty</span> <span class="op">=</span> <span class="ident">Flags::empty</span>();
|
||||
<span class="kw">let</span> <span class="ident">none</span> <span class="op">=</span> <span class="ident">Flags::NONE</span>;
|
||||
<span class="kw">let</span> <span class="ident">some</span> <span class="op">=</span> <span class="ident">Flags::SOME</span>;
|
||||
|
||||
<span class="comment">// Zero flags are treated as always present</span>
|
||||
<span class="macro">assert!</span>(<span class="ident">empty</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
|
||||
<span class="macro">assert!</span>(<span class="ident">none</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
|
||||
<span class="macro">assert!</span>(<span class="ident">some</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
|
||||
|
||||
<span class="comment">// Zero flags will be ignored when testing for emptiness</span>
|
||||
<span class="macro">assert!</span>(<span class="ident">none</span>.<span class="ident">is_empty</span>());
|
||||
}</code></pre></div>
|
||||
<p>Users should generally avoid defining a flag with a value of zero.</p>
|
||||
</div></details><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.bitflags.html" title="bitflags::bitflags macro">bitflags</a></div><div class="item-right docblock-short"><p>The macro used to generate the flag structures.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/bitflags/macro.bitflags!.html
Normal file
11
ch6/bitflags/macro.bitflags!.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.bitflags.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.bitflags.html">macro.bitflags.html</a>...</p>
|
||||
<script>location.replace("macro.bitflags.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
79
ch6/bitflags/macro.bitflags.html
Normal file
79
ch6/bitflags/macro.bitflags.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!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="The macro used to generate the flag structures."><meta name="keywords" content="rust, rustlang, rust-lang, bitflags"><title>bitflags in bitflags - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In bitflags</a></h2><div id="sidebar-vars" data-name="bitflags" data-ty="macro" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Macro <a href="index.html">bitflags</a>::<wbr><a class="macro" href="#">bitflags</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bitflags/lib.rs.html#350-382">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><div class="example-wrap"><pre class="rust macro"><code><span class="macro">macro_rules!</span> <span class="ident">bitflags</span> {
|
||||
(
|
||||
$(<span class="attribute">#[<span class="macro-nonterminal">$</span><span class="macro-nonterminal">outer</span>:<span class="ident">meta</span>]</span>)<span class="op">*</span>
|
||||
<span class="macro-nonterminal">$</span><span class="macro-nonterminal">vis</span>:<span class="ident">vis</span> <span class="kw">struct</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">BitFlags</span>:<span class="ident">ident</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">T</span>:<span class="ident">ty</span> {
|
||||
$(
|
||||
$(<span class="attribute">#[<span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">ident</span> $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>]</span>)<span class="op">*</span>
|
||||
<span class="kw">const</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">Flag</span>:<span class="ident">ident</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span>;
|
||||
)<span class="op">*</span>
|
||||
}
|
||||
|
||||
$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span>)<span class="op">*</span>
|
||||
) => { ... };
|
||||
() => { ... };
|
||||
}</code></pre></div>
|
||||
</div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The macro used to generate the flag structures.</p>
|
||||
<p>See the <a href="../bitflags/index.html">crate level docs</a> for complete documentation.</p>
|
||||
<h2 id="example"><a href="#example">Example</a></h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
|
||||
<span class="kw">const</span> <span class="ident">ABC</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::A</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::B</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::C</span>.<span class="ident">bits</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">e1</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
|
||||
<span class="kw">let</span> <span class="ident">e2</span> <span class="op">=</span> <span class="ident">Flags::B</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">|</span> <span class="ident">e2</span>), <span class="ident">Flags::ABC</span>); <span class="comment">// union</span>
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">&</span> <span class="ident">e2</span>), <span class="ident">Flags::C</span>); <span class="comment">// intersection</span>
|
||||
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">-</span> <span class="ident">e2</span>), <span class="ident">Flags::A</span>); <span class="comment">// set difference</span>
|
||||
<span class="macro">assert_eq!</span>(<span class="op">!</span><span class="ident">e2</span>, <span class="ident">Flags::A</span>); <span class="comment">// set complement</span>
|
||||
}</code></pre></div>
|
||||
<p>The generated <code>struct</code>s can also be extended with type and trait
|
||||
implementations:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
|
||||
|
||||
<span class="macro">bitflags!</span> {
|
||||
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
|
||||
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
|
||||
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Flags</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) {
|
||||
<span class="self">self</span>.<span class="ident">bits</span> <span class="op">=</span> <span class="number">0</span>; <span class="comment">// The `bits` field can be accessed from within the</span>
|
||||
<span class="comment">// same module where the `bitflags!` macro was invoked.</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">fmt::Display</span> <span class="kw">for</span> <span class="ident">Flags</span> {
|
||||
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&mut</span> <span class="ident">fmt::Formatter</span>) -> <span class="ident">fmt::Result</span> {
|
||||
<span class="macro">write!</span>(<span class="ident">f</span>, <span class="string">"hi!"</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">flags</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>;
|
||||
<span class="ident">flags</span>.<span class="ident">clear</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">flags</span>.<span class="ident">is_empty</span>());
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{}"</span>, <span class="ident">flags</span>), <span class="string">"hi!"</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{:?}"</span>, <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>), <span class="string">"A | B"</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">"{:?}"</span>, <span class="ident">Flags::B</span>), <span class="string">"B"</span>);
|
||||
}</code></pre></div>
|
||||
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/bitflags/sidebar-items.js
Normal file
1
ch6/bitflags/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"macro":[["bitflags","The macro used to generate the flag structures."]]});
|
7
ch6/buddy_system_allocator/all.html
Normal file
7
ch6/buddy_system_allocator/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate buddy_system_allocator</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.FrameAllocator.html">FrameAllocator</a></li><li><a href="struct.Heap.html">Heap</a></li><li><a href="struct.LockedFrameAllocator.html">LockedFrameAllocator</a></li><li><a href="struct.LockedHeap.html">LockedHeap</a></li><li><a href="struct.LockedHeapWithRescue.html">LockedHeapWithRescue</a></li><li><a href="linked_list/struct.Iter.html">linked_list::Iter</a></li><li><a href="linked_list/struct.IterMut.html">linked_list::IterMut</a></li><li><a href="linked_list/struct.LinkedList.html">linked_list::LinkedList</a></li><li><a href="linked_list/struct.ListNode.html">linked_list::ListNode</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/buddy_system_allocator/frame/struct.FrameAllocator.html
Normal file
11
ch6/buddy_system_allocator/frame/struct.FrameAllocator.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../buddy_system_allocator/struct.FrameAllocator.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../buddy_system_allocator/struct.FrameAllocator.html">../../buddy_system_allocator/struct.FrameAllocator.html</a>...</p>
|
||||
<script>location.replace("../../buddy_system_allocator/struct.FrameAllocator.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../buddy_system_allocator/struct.LockedFrameAllocator.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../buddy_system_allocator/struct.LockedFrameAllocator.html">../../buddy_system_allocator/struct.LockedFrameAllocator.html</a>...</p>
|
||||
<script>location.replace("../../buddy_system_allocator/struct.LockedFrameAllocator.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
17
ch6/buddy_system_allocator/index.html
Normal file
17
ch6/buddy_system_allocator/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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 `buddy_system_allocator` crate."><meta name="keywords" content="rust, rustlang, rust-lang, buddy_system_allocator"><title>buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate buddy_system_allocator</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.6.0</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li></ul></div></section><div id="sidebar-vars" data-name="buddy_system_allocator" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">buddy_system_allocator</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#1-342">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="linked_list/index.html" title="buddy_system_allocator::linked_list mod">linked_list</a></div><div class="item-right docblock-short"><p>Provide the intrusive LinkedList</p>
|
||||
</div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FrameAllocator.html" title="buddy_system_allocator::FrameAllocator struct">FrameAllocator</a></div><div class="item-right docblock-short"><p>A frame allocator that uses buddy system,
|
||||
requiring a global allocator</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Heap.html" title="buddy_system_allocator::Heap struct">Heap</a></div><div class="item-right docblock-short"><p>A heap that uses buddy system</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LockedFrameAllocator.html" title="buddy_system_allocator::LockedFrameAllocator struct">LockedFrameAllocator</a></div><div class="item-right docblock-short"><p>A locked version of <code>FrameAllocator</code></p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LockedHeap.html" title="buddy_system_allocator::LockedHeap struct">LockedHeap</a></div><div class="item-right docblock-short"><p>A locked version of <code>Heap</code></p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LockedHeapWithRescue.html" title="buddy_system_allocator::LockedHeapWithRescue struct">LockedHeapWithRescue</a></div><div class="item-right docblock-short"><p>A locked version of <code>Heap</code> with rescue before oom</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
14
ch6/buddy_system_allocator/linked_list/index.html
Normal file
14
ch6/buddy_system_allocator/linked_list/index.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!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="Provide the intrusive LinkedList"><meta name="keywords" content="rust, rustlang, rust-lang, linked_list"><title>buddy_system_allocator::linked_list - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module linked_list</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section><div id="sidebar-vars" data-name="linked_list" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../buddy_system_allocator/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">buddy_system_allocator</a>::<wbr><a class="mod" href="#">linked_list</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#1-141">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provide the intrusive LinkedList</p>
|
||||
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Iter.html" title="buddy_system_allocator::linked_list::Iter struct">Iter</a></div><div class="item-right docblock-short"><p>An iterator over the linked list</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IterMut.html" title="buddy_system_allocator::linked_list::IterMut struct">IterMut</a></div><div class="item-right docblock-short"><p>A mutable iterator over the linked list</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LinkedList.html" title="buddy_system_allocator::linked_list::LinkedList struct">LinkedList</a></div><div class="item-right docblock-short"><p>An intrusive linked list</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ListNode.html" title="buddy_system_allocator::linked_list::ListNode struct">ListNode</a></div><div class="item-right docblock-short"><p>Represent a mutable node in <code>LinkedList</code></p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/buddy_system_allocator/linked_list/sidebar-items.js
Normal file
1
ch6/buddy_system_allocator/linked_list/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"struct":[["Iter","An iterator over the linked list"],["IterMut","A mutable iterator over the linked list"],["LinkedList","An intrusive linked list"],["ListNode","Represent a mutable node in `LinkedList`"]]});
|
135
ch6/buddy_system_allocator/linked_list/struct.Iter.html
Normal file
135
ch6/buddy_system_allocator/linked_list/struct.Iter.html
Normal file
@ -0,0 +1,135 @@
|
||||
<!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="An iterator over the linked list"><meta name="keywords" content="rust, rustlang, rust-lang, Iter"><title>Iter in buddy_system_allocator::linked_list - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Iter</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Iterator">Iterator</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">!Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-IntoIterator">IntoIterator</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator::linked_list</a></h2><div id="sidebar-vars" data-name="Iter" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../buddy_system_allocator/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../index.html">buddy_system_allocator</a>::<wbr><a href="index.html">linked_list</a>::<wbr><a class="struct" href="#">Iter</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#76-79">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct Iter<'a> { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An iterator over the linked list</p>
|
||||
</div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Iterator" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#81-94">source</a></span><a href="#impl-Iterator" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item" class="type trait-impl has-srclink"><a href="#associatedtype.Item" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.next" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#84-93">source</a></span><a href="#method.next" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next" class="fnname">next</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Advances the iterator and returns the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.size_hint" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#167">source</a></span><a href="#method.size_hint" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint" class="fnname">size_hint</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</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="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></h4></section></summary><div class='docblock'><p>Returns the bounds on the remaining length of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.count" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#204-206">source</a></span><a href="#method.count" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count" class="fnname">count</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'><p>Consumes the iterator, counting the number of iterations and returning it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.last" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#234-236">source</a></span><a href="#method.last" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last" class="fnname">last</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Consumes the iterator, returning the last element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.advance_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#280">source</a></span><a href="#method.advance_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by" class="fnname">advance_by</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <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/core/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_advance_by</code>)</div></span><div class='docblock'><p>Advances the iterator by <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.nth" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#328">source</a></span><a href="#method.nth" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth" class="fnname">nth</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Returns the <code>n</code>th element of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.step_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#380-382">source</a></span><a href="#method.step_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by" class="fnname">step_by</a>(self, step: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/step_by/struct.StepBy.html" title="struct core::iter::adapters::step_by::StepBy">StepBy</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator starting at the same point, but stepping by
|
||||
the given amount at each iteration. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.chain" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#451-454">source</a></span><a href="#method.chain" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain" class="fnname">chain</a><U>(self, other: U) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/chain/struct.Chain.html" title="struct core::iter::adapters::chain::Chain">Chain</a><Self, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Takes two iterators and creates a new iterator over both in sequence. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.zip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#565-568">source</a></span><a href="#method.zip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip" class="fnname">zip</a><U>(self, other: U) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/zip/struct.Zip.html" title="struct core::iter::adapters::zip::Zip">Zip</a><Self, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>, </span></h4></section></summary><div class='docblock'><p>‘Zips up’ two iterators into a single iterator of pairs. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersperse" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#607-610">source</a></span><a href="#method.intersperse" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse" class="fnname">intersperse</a>(self, separator: Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/intersperse/struct.Intersperse.html" title="struct core::iter::adapters::intersperse::Intersperse">Intersperse</a><Self> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_intersperse</code>)</div></span><div class='docblock'><p>Creates a new iterator which places a copy of <code>separator</code> between adjacent
|
||||
items of the original iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersperse_with" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#665-668">source</a></span><a href="#method.intersperse_with" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse_with" class="fnname">intersperse_with</a><G>(self, separator: G) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/intersperse/struct.IntersperseWith.html" title="struct core::iter::adapters::intersperse::IntersperseWith">IntersperseWith</a><Self, G> <span class="where fmt-newline">where<br> G: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>() -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_intersperse</code>)</div></span><div class='docblock'><p>Creates a new iterator which places an item generated by <code>separator</code>
|
||||
between adjacent items of the original iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse_with">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#724-727">source</a></span><a href="#method.map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map" class="fnname">map</a><B, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map/struct.Map.html" title="struct core::iter::adapters::map::Map">Map</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Takes a closure and creates an iterator which calls that closure on each
|
||||
element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.for_each" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#769-772">source</a></span><a href="#method.for_each" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each" class="fnname">for_each</a><F>(self, f: F) <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>), </span></h4></section></summary><div class='docblock'><p>Calls a closure on each element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.filter" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#844-847">source</a></span><a href="#method.filter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter" class="fnname">filter</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter/struct.Filter.html" title="struct core::iter::adapters::filter::Filter">Filter</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which uses a closure to determine if an element
|
||||
should be yielded. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.filter_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#889-892">source</a></span><a href="#method.filter_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map" class="fnname">filter_map</a><B, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter_map/struct.FilterMap.html" title="struct core::iter::adapters::filter_map::FilterMap">FilterMap</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that both filters and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.enumerate" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#935-937">source</a></span><a href="#method.enumerate" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate" class="fnname">enumerate</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/enumerate/struct.Enumerate.html" title="struct core::iter::adapters::enumerate::Enumerate">Enumerate</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which gives the current iteration count as well as
|
||||
the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.peekable" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1006-1008">source</a></span><a href="#method.peekable" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable" class="fnname">peekable</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html" title="struct core::iter::adapters::peekable::Peekable">Peekable</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which can use the <a href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html#method.peek"><code>peek</code></a> and <a href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html#method.peek_mut"><code>peek_mut</code></a> methods
|
||||
to look at the next element of the iterator without consuming it. See
|
||||
their documentation for more information. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.skip_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1071-1074">source</a></span><a href="#method.skip_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while" class="fnname">skip_while</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip_while/struct.SkipWhile.html" title="struct core::iter::adapters::skip_while::SkipWhile">SkipWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip"><code>skip</code></a>s elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1152-1155">source</a></span><a href="#method.take_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while" class="fnname">take_while</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take_while/struct.TakeWhile.html" title="struct core::iter::adapters::take_while::TakeWhile">TakeWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that yields elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.57.0">1.57.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1240-1243">source</a></span><a href="#method.map_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while" class="fnname">map_while</a><B, P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map_while/struct.MapWhile.html" title="struct core::iter::adapters::map_while::MapWhile">MapWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that both yields elements based on a predicate and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.skip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1271-1273">source</a></span><a href="#method.skip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip" class="fnname">skip</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip/struct.Skip.html" title="struct core::iter::adapters::skip::Skip">Skip</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator that skips the first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1324-1326">source</a></span><a href="#method.take" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take" class="fnname">take</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take/struct.Take.html" title="struct core::iter::adapters::take::Take">Take</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator that yields the first <code>n</code> elements, or fewer
|
||||
if the underlying iterator ends sooner. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.scan" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1368-1371">source</a></span><a href="#method.scan" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan" class="fnname">scan</a><St, B, F>(self, initial_state: St, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/scan/struct.Scan.html" title="struct core::iter::adapters::scan::Scan">Scan</a><Self, St, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>St, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>An iterator adapter similar to <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold"><code>fold</code></a> that holds internal state and
|
||||
produces a new iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flat_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1408-1412">source</a></span><a href="#method.flat_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map" class="fnname">flat_map</a><U, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.FlatMap.html" title="struct core::iter::adapters::flatten::FlatMap">FlatMap</a><Self, U, F> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> U, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that works like map, but flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flatten" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.29.0">1.29.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1480-1483">source</a></span><a href="#method.flatten" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten" class="fnname">flatten</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.Flatten.html" title="struct core::iter::adapters::flatten::Flatten">Flatten</a><Self> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fuse" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1548-1550">source</a></span><a href="#method.fuse" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse" class="fnname">fuse</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/fuse/struct.Fuse.html" title="struct core::iter::adapters::fuse::Fuse">Fuse</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which ends after the first <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="None"><code>None</code></a>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.inspect" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1632-1635">source</a></span><a href="#method.inspect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect" class="fnname">inspect</a><F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/inspect/struct.Inspect.html" title="struct core::iter::adapters::inspect::Inspect">Inspect</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>), </span></h4></section></summary><div class='docblock'><p>Does something with each element of an iterator, passing the value on. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.by_ref" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1662-1664">source</a></span><a href="#method.by_ref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>Self</h4></section></summary><div class='docblock'><p>Borrows an iterator, rather than consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.collect" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1780-1782">source</a></span><a href="#method.collect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect" class="fnname">collect</a><B>(self) -> B <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Transforms an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_collect" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1858-1863">source</a></span><a href="#method.try_collect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_collect" class="fnname">try_collect</a><B>(<br> &mut self<br>) -> <<Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><B>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><<Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Output" title="type core::ops::try_trait::Try::Output">Output</a>>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>,<br> <Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><B>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iterator_try_collect</code>)</div></span><div class='docblock'><p>Fallibly transforms an iterator into a collection, short circuiting if
|
||||
a failure is encountered. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_collect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.collect_into" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1931-1933">source</a></span><a href="#method.collect_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect_into" class="fnname">collect_into</a><E>(self, collection: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>E) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>E <span class="where fmt-newline">where<br> E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_collect_into</code>)</div></span><div class='docblock'><p>Collects all the items from an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect_into">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partition" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1965-1969">source</a></span><a href="#method.partition" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition" class="fnname">partition</a><B, F>(self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>B, B<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Consumes an iterator, creating two collections from it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partition_in_place" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2027-2030">source</a></span><a href="#method.partition_in_place" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place" class="fnname">partition_in_place</a><'a, T, P>(self, predicate: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br> T: 'a,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a mut </a>T>,<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_partition_in_place</code>)</div></span><div class='docblock'><p>Reorders the elements of this iterator <em>in-place</em> according to the given predicate,
|
||||
such that all those that return <code>true</code> precede all those that return <code>false</code>.
|
||||
Returns the number of <code>true</code> elements found. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_partitioned" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2084-2087">source</a></span><a href="#method.is_partitioned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned" class="fnname">is_partitioned</a><P>(self, predicate: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_is_partitioned</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are partitioned according to the given predicate,
|
||||
such that all those that return <code>true</code> precede all those that return <code>false</code>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_fold" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2178-2182">source</a></span><a href="#method.try_fold" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold" class="fnname">try_fold</a><B, F, R>(&mut self, init: B, f: F) -> R <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = B>, </span></h4></section></summary><div class='docblock'><p>An iterator method that applies a function as long as it returns
|
||||
successfully, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_for_each" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2236-2240">source</a></span><a href="#method.try_for_each" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each" class="fnname">try_for_each</a><F, R>(&mut self, f: F) -> R <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>>, </span></h4></section></summary><div class='docblock'><p>An iterator method that applies a fallible function to each item in the
|
||||
iterator, stopping at the first error and returning that error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fold" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2355-2358">source</a></span><a href="#method.fold" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold" class="fnname">fold</a><B, F>(self, init: B, f: F) -> B <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Folds every element into an accumulator by applying an operation,
|
||||
returning the final result. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reduce" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2401-2404">source</a></span><a href="#method.reduce" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.reduce" class="fnname">reduce</a><F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, </span></h4></section></summary><div class='docblock'><p>Reduces the elements to a single one, by repeatedly applying a reducing
|
||||
operation. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.reduce">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_reduce" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2472-2477">source</a></span><a href="#method.try_reduce" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_reduce" class="fnname">try_reduce</a><F, R>(<br> &mut self, <br> f: F<br>) -> <<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Output" title="type core::ops::try_trait::Try::Output">Output</a>>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> <R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iterator_try_reduce</code>)</div></span><div class='docblock'><p>Reduces the elements to a single one by repeatedly applying a reducing operation. If the
|
||||
closure returns a failure, the failure is propagated back to the caller immediately. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_reduce">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.all" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2529-2532">source</a></span><a href="#method.all" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all" class="fnname">all</a><F>(&mut self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Tests if every element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.any" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2582-2585">source</a></span><a href="#method.any" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any" class="fnname">any</a><F>(&mut self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Tests if any element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2642-2645">source</a></span><a href="#method.find" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find" class="fnname">find</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element of an iterator that satisfies a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2673-2676">source</a></span><a href="#method.find_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map" class="fnname">find_map</a><B, F>(&mut self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Applies function to the elements of iterator and returns
|
||||
the first non-none result. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_find" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2729-2734">source</a></span><a href="#method.try_find" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find" class="fnname">try_find</a><F, R>(<br> &mut self, <br> f: F<br>) -> <<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>>,<br> <R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>try_find</code>)</div></span><div class='docblock'><p>Applies function to the elements of iterator and returns
|
||||
the first true result or the first error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.position" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2811-2814">source</a></span><a href="#method.position" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position" class="fnname">position</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element in an iterator, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.rposition" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2868-2871">source</a></span><a href="#method.rposition" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition" class="fnname">rposition</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/exact_size/trait.ExactSizeIterator.html" title="trait core::iter::traits::exact_size::ExactSizeIterator">ExactSizeIterator</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element in an iterator from the right, returning its
|
||||
index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2919-2922">source</a></span><a href="#method.max" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max" class="fnname">max</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p>Returns the maximum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2957-2960">source</a></span><a href="#method.min" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min" class="fnname">min</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p>Returns the minimum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max_by_key" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2979-2982">source</a></span><a href="#method.max_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key" class="fnname">max_by_key</a><B, F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the maximum value from the
|
||||
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3012-3015">source</a></span><a href="#method.max_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by" class="fnname">max_by</a><F>(self, compare: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the maximum value with respect to the
|
||||
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min_by_key" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3039-3042">source</a></span><a href="#method.min_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key" class="fnname">min_by_key</a><B, F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the minimum value from the
|
||||
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3072-3075">source</a></span><a href="#method.min_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by" class="fnname">min_by</a><F>(self, compare: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the minimum value with respect to the
|
||||
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.rev" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3109-3111">source</a></span><a href="#method.rev" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev" class="fnname">rev</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a><Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>, </span></h4></section></summary><div class='docblock'><p>Reverses an iterator’s direction. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.unzip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3147-3151">source</a></span><a href="#method.unzip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip" class="fnname">unzip</a><A, B, FromA, FromB>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>FromA, FromB<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> FromA: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><A>,<br> FromB: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><B>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>A, B<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a>>, </span></h4></section></summary><div class='docblock'><p>Converts an iterator of pairs into a pair of containers. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.copied" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3179-3182">source</a></span><a href="#method.copied" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied" class="fnname">copied</a><'a, T>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/copied/struct.Copied.html" title="struct core::iter::adapters::copied::Copied">Copied</a><Self> <span class="where fmt-newline">where<br> T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a </a>T>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which copies all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cloned" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3226-3229">source</a></span><a href="#method.cloned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned" class="fnname">cloned</a><'a, T>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cloned/struct.Cloned.html" title="struct core::iter::adapters::cloned::Cloned">Cloned</a><Self> <span class="where fmt-newline">where<br> T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a </a>T>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone"><code>clone</code></a>s all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cycle" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3260-3262">source</a></span><a href="#method.cycle" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle" class="fnname">cycle</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cycle/struct.Cycle.html" title="struct core::iter::adapters::cycle::Cycle">Cycle</a><Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h4></section></summary><div class='docblock'><p>Repeats an iterator endlessly. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sum" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3290-3293">source</a></span><a href="#method.sum" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum" class="fnname">sum</a><S>(self) -> S <span class="where fmt-newline">where<br> S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Sums the elements of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.product" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3319-3322">source</a></span><a href="#method.product" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product" class="fnname">product</a><P>(self) -> P <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Product.html" title="trait core::iter::traits::accum::Product">Product</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Iterates over the entire iterator, multiplying all the elements <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3340-3344">source</a></span><a href="#method.cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp" class="fnname">cmp</a><I>(self, other: I) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3369-3373">source</a></span><a href="#method.cmp_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by" class="fnname">cmp_by</a><I, F>(self, other: I, cmp: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3416-3420">source</a></span><a href="#method.partial_cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp" class="fnname">partial_cmp</a><I>(self, other: I) -> <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="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3454-3458">source</a></span><a href="#method.partial_cmp_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by" class="fnname">partial_cmp_by</a><I, F>(self, other: I, partial_cmp: F) -> <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="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</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="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3496-3500">source</a></span><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq" class="fnname">eq</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
|
||||
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3521-3525">source</a></span><a href="#method.eq_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by" class="fnname">eq_by</a><I, F>(self, other: I, eq: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
|
||||
another with respect to the specified equality function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3556-3560">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne" class="fnname">ne</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are unequal to those of
|
||||
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3577-3581">source</a></span><a href="#method.lt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt" class="fnname">lt</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
less than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.le" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3598-3602">source</a></span><a href="#method.le" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le" class="fnname">le</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
less or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3619-3623">source</a></span><a href="#method.gt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt" class="fnname">gt</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
greater than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3640-3644">source</a></span><a href="#method.ge" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge" class="fnname">ge</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
greater than or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3671-3674">source</a></span><a href="#method.is_sorted" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted" class="fnname">is_sorted</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3699-3702">source</a></span><a href="#method.is_sorted_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by" class="fnname">is_sorted_by</a><F>(self, compare: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</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="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted using the given comparator function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted_by_key" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3745-3749">source</a></span><a href="#method.is_sorted_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key" class="fnname">is_sorted_by_key</a><F, K>(self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> K,<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><K>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted using the given key extraction
|
||||
function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key">Read more</a></p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">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.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">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.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">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.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">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.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">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.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-IntoIterator" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#271-279">source</a></span><a href="#impl-IntoIterator" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item-1" class="type trait-impl has-srclink"><a href="#associatedtype.Item-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a></h4></section></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter" class="type trait-impl has-srclink"><a href="#associatedtype.IntoIter" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = I</h4></section></summary><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#276">source</a></span><a href="#method.into_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -> I</h4></section></summary><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
135
ch6/buddy_system_allocator/linked_list/struct.IterMut.html
Normal file
135
ch6/buddy_system_allocator/linked_list/struct.IterMut.html
Normal file
@ -0,0 +1,135 @@
|
||||
<!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 mutable iterator over the linked list"><meta name="keywords" content="rust, rustlang, rust-lang, IterMut"><title>IterMut in buddy_system_allocator::linked_list - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">IterMut</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Iterator">Iterator</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">!Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">!UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-IntoIterator">IntoIterator</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator::linked_list</a></h2><div id="sidebar-vars" data-name="IterMut" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../buddy_system_allocator/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../index.html">buddy_system_allocator</a>::<wbr><a href="index.html">linked_list</a>::<wbr><a class="struct" href="#">IterMut</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#119-123">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct IterMut<'a> { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A mutable iterator over the linked list</p>
|
||||
</div></details><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Iterator" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#125-141">source</a></span><a href="#impl-Iterator" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item" class="type trait-impl has-srclink"><a href="#associatedtype.Item" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="struct" href="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h4></section></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.next" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#128-140">source</a></span><a href="#method.next" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next" class="fnname">next</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Advances the iterator and returns the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#tymethod.next">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.size_hint" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#167">source</a></span><a href="#method.size_hint" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint" class="fnname">size_hint</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</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="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></h4></section></summary><div class='docblock'><p>Returns the bounds on the remaining length of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.size_hint">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.count" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#204-206">source</a></span><a href="#method.count" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count" class="fnname">count</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class='docblock'><p>Consumes the iterator, counting the number of iterations and returning it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.count">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.last" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#234-236">source</a></span><a href="#method.last" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last" class="fnname">last</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Consumes the iterator, returning the last element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.last">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.advance_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#280">source</a></span><a href="#method.advance_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by" class="fnname">advance_by</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <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/core/primitive.unit.html">()</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_advance_by</code>)</div></span><div class='docblock'><p>Advances the iterator by <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.advance_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.nth" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#328">source</a></span><a href="#method.nth" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth" class="fnname">nth</a>(&mut self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>></h4></section></summary><div class='docblock'><p>Returns the <code>n</code>th element of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.nth">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.step_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#380-382">source</a></span><a href="#method.step_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by" class="fnname">step_by</a>(self, step: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/step_by/struct.StepBy.html" title="struct core::iter::adapters::step_by::StepBy">StepBy</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator starting at the same point, but stepping by
|
||||
the given amount at each iteration. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.step_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.chain" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#451-454">source</a></span><a href="#method.chain" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain" class="fnname">chain</a><U>(self, other: U) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/chain/struct.Chain.html" title="struct core::iter::adapters::chain::Chain">Chain</a><Self, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Takes two iterators and creates a new iterator over both in sequence. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.chain">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.zip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#565-568">source</a></span><a href="#method.zip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip" class="fnname">zip</a><U>(self, other: U) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/zip/struct.Zip.html" title="struct core::iter::adapters::zip::Zip">Zip</a><Self, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>, </span></h4></section></summary><div class='docblock'><p>‘Zips up’ two iterators into a single iterator of pairs. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.zip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersperse" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#607-610">source</a></span><a href="#method.intersperse" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse" class="fnname">intersperse</a>(self, separator: Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/intersperse/struct.Intersperse.html" title="struct core::iter::adapters::intersperse::Intersperse">Intersperse</a><Self> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_intersperse</code>)</div></span><div class='docblock'><p>Creates a new iterator which places a copy of <code>separator</code> between adjacent
|
||||
items of the original iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.intersperse_with" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#665-668">source</a></span><a href="#method.intersperse_with" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse_with" class="fnname">intersperse_with</a><G>(self, separator: G) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/intersperse/struct.IntersperseWith.html" title="struct core::iter::adapters::intersperse::IntersperseWith">IntersperseWith</a><Self, G> <span class="where fmt-newline">where<br> G: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>() -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_intersperse</code>)</div></span><div class='docblock'><p>Creates a new iterator which places an item generated by <code>separator</code>
|
||||
between adjacent items of the original iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.intersperse_with">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#724-727">source</a></span><a href="#method.map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map" class="fnname">map</a><B, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map/struct.Map.html" title="struct core::iter::adapters::map::Map">Map</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Takes a closure and creates an iterator which calls that closure on each
|
||||
element. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.for_each" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.21.0">1.21.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#769-772">source</a></span><a href="#method.for_each" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each" class="fnname">for_each</a><F>(self, f: F) <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>), </span></h4></section></summary><div class='docblock'><p>Calls a closure on each element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.for_each">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.filter" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#844-847">source</a></span><a href="#method.filter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter" class="fnname">filter</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter/struct.Filter.html" title="struct core::iter::adapters::filter::Filter">Filter</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which uses a closure to determine if an element
|
||||
should be yielded. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.filter_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#889-892">source</a></span><a href="#method.filter_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map" class="fnname">filter_map</a><B, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/filter_map/struct.FilterMap.html" title="struct core::iter::adapters::filter_map::FilterMap">FilterMap</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that both filters and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.filter_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.enumerate" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#935-937">source</a></span><a href="#method.enumerate" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate" class="fnname">enumerate</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/enumerate/struct.Enumerate.html" title="struct core::iter::adapters::enumerate::Enumerate">Enumerate</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which gives the current iteration count as well as
|
||||
the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.enumerate">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.peekable" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1006-1008">source</a></span><a href="#method.peekable" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable" class="fnname">peekable</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html" title="struct core::iter::adapters::peekable::Peekable">Peekable</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which can use the <a href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html#method.peek"><code>peek</code></a> and <a href="https://doc.rust-lang.org/nightly/core/iter/adapters/peekable/struct.Peekable.html#method.peek_mut"><code>peek_mut</code></a> methods
|
||||
to look at the next element of the iterator without consuming it. See
|
||||
their documentation for more information. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.peekable">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.skip_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1071-1074">source</a></span><a href="#method.skip_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while" class="fnname">skip_while</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip_while/struct.SkipWhile.html" title="struct core::iter::adapters::skip_while::SkipWhile">SkipWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip"><code>skip</code></a>s elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1152-1155">source</a></span><a href="#method.take_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while" class="fnname">take_while</a><P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take_while/struct.TakeWhile.html" title="struct core::iter::adapters::take_while::TakeWhile">TakeWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that yields elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map_while" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.57.0">1.57.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1240-1243">source</a></span><a href="#method.map_while" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while" class="fnname">map_while</a><B, P>(self, predicate: P) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/map_while/struct.MapWhile.html" title="struct core::iter::adapters::map_while::MapWhile">MapWhile</a><Self, P> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that both yields elements based on a predicate and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.map_while">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.skip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1271-1273">source</a></span><a href="#method.skip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip" class="fnname">skip</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/skip/struct.Skip.html" title="struct core::iter::adapters::skip::Skip">Skip</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator that skips the first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.skip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.take" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1324-1326">source</a></span><a href="#method.take" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take" class="fnname">take</a>(self, n: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/take/struct.Take.html" title="struct core::iter::adapters::take::Take">Take</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator that yields the first <code>n</code> elements, or fewer
|
||||
if the underlying iterator ends sooner. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.take">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.scan" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1368-1371">source</a></span><a href="#method.scan" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan" class="fnname">scan</a><St, B, F>(self, initial_state: St, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/scan/struct.Scan.html" title="struct core::iter::adapters::scan::Scan">Scan</a><Self, St, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>St, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>An iterator adapter similar to <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold"><code>fold</code></a> that holds internal state and
|
||||
produces a new iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.scan">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flat_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1408-1412">source</a></span><a href="#method.flat_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map" class="fnname">flat_map</a><U, F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.FlatMap.html" title="struct core::iter::adapters::flatten::FlatMap">FlatMap</a><Self, U, F> <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> U, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that works like map, but flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flat_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flatten" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.29.0">1.29.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1480-1483">source</a></span><a href="#method.flatten" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten" class="fnname">flatten</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/flatten/struct.Flatten.html" title="struct core::iter::adapters::flatten::Flatten">Flatten</a><Self> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator that flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.flatten">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fuse" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1548-1550">source</a></span><a href="#method.fuse" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse" class="fnname">fuse</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/fuse/struct.Fuse.html" title="struct core::iter::adapters::fuse::Fuse">Fuse</a><Self></h4></section></summary><div class='docblock'><p>Creates an iterator which ends after the first <a href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html#variant.None" title="None"><code>None</code></a>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fuse">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.inspect" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1632-1635">source</a></span><a href="#method.inspect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect" class="fnname">inspect</a><F>(self, f: F) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/inspect/struct.Inspect.html" title="struct core::iter::adapters::inspect::Inspect">Inspect</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>), </span></h4></section></summary><div class='docblock'><p>Does something with each element of an iterator, passing the value on. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.inspect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.by_ref" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1662-1664">source</a></span><a href="#method.by_ref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref" class="fnname">by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>Self</h4></section></summary><div class='docblock'><p>Borrows an iterator, rather than consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.by_ref">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.collect" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1780-1782">source</a></span><a href="#method.collect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect" class="fnname">collect</a><B>(self) -> B <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Transforms an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_collect" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1858-1863">source</a></span><a href="#method.try_collect" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_collect" class="fnname">try_collect</a><B>(<br> &mut self<br>) -> <<Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><B>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.FromIterator.html" title="trait core::iter::traits::collect::FromIterator">FromIterator</a><<Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Output" title="type core::ops::try_trait::Try::Output">Output</a>>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>,<br> <Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><B>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iterator_try_collect</code>)</div></span><div class='docblock'><p>Fallibly transforms an iterator into a collection, short circuiting if
|
||||
a failure is encountered. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_collect">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.collect_into" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1931-1933">source</a></span><a href="#method.collect_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect_into" class="fnname">collect_into</a><E>(self, collection: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>E) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>E <span class="where fmt-newline">where<br> E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_collect_into</code>)</div></span><div class='docblock'><p>Collects all the items from an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.collect_into">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partition" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#1965-1969">source</a></span><a href="#method.partition" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition" class="fnname">partition</a><B, F>(self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>B, B<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Consumes an iterator, creating two collections from it. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partition_in_place" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2027-2030">source</a></span><a href="#method.partition_in_place" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place" class="fnname">partition_in_place</a><'a, T, P>(self, predicate: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> <span class="where fmt-newline">where<br> T: 'a,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a mut </a>T>,<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_partition_in_place</code>)</div></span><div class='docblock'><p>Reorders the elements of this iterator <em>in-place</em> according to the given predicate,
|
||||
such that all those that return <code>true</code> precede all those that return <code>false</code>.
|
||||
Returns the number of <code>true</code> elements found. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partition_in_place">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_partitioned" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2084-2087">source</a></span><a href="#method.is_partitioned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned" class="fnname">is_partitioned</a><P>(self, predicate: P) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_is_partitioned</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are partitioned according to the given predicate,
|
||||
such that all those that return <code>true</code> precede all those that return <code>false</code>. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_partitioned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_fold" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2178-2182">source</a></span><a href="#method.try_fold" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold" class="fnname">try_fold</a><B, F, R>(&mut self, init: B, f: F) -> R <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = B>, </span></h4></section></summary><div class='docblock'><p>An iterator method that applies a function as long as it returns
|
||||
successfully, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_fold">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_for_each" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.27.0">1.27.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2236-2240">source</a></span><a href="#method.try_for_each" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each" class="fnname">try_for_each</a><F, R>(&mut self, f: F) -> R <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>>, </span></h4></section></summary><div class='docblock'><p>An iterator method that applies a fallible function to each item in the
|
||||
iterator, stopping at the first error and returning that error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_for_each">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fold" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2355-2358">source</a></span><a href="#method.fold" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold" class="fnname">fold</a><B, F>(self, init: B, f: F) -> B <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(B, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Folds every element into an accumulator by applying an operation,
|
||||
returning the final result. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.fold">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.reduce" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.51.0">1.51.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2401-2404">source</a></span><a href="#method.reduce" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.reduce" class="fnname">reduce</a><F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, </span></h4></section></summary><div class='docblock'><p>Reduces the elements to a single one, by repeatedly applying a reducing
|
||||
operation. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.reduce">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_reduce" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2472-2477">source</a></span><a href="#method.try_reduce" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_reduce" class="fnname">try_reduce</a><F, R>(<br> &mut self, <br> f: F<br>) -> <<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Output" title="type core::ops::try_trait::Try::Output">Output</a>>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> <R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iterator_try_reduce</code>)</div></span><div class='docblock'><p>Reduces the elements to a single one by repeatedly applying a reducing operation. If the
|
||||
closure returns a failure, the failure is propagated back to the caller immediately. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_reduce">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.all" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2529-2532">source</a></span><a href="#method.all" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all" class="fnname">all</a><F>(&mut self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Tests if every element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.all">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.any" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2582-2585">source</a></span><a href="#method.any" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any" class="fnname">any</a><F>(&mut self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Tests if any element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.any">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2642-2645">source</a></span><a href="#method.find" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find" class="fnname">find</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element of an iterator that satisfies a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find_map" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.30.0">1.30.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2673-2676">source</a></span><a href="#method.find_map" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map" class="fnname">find_map</a><B, F>(&mut self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></h4></section></summary><div class='docblock'><p>Applies function to the elements of iterator and returns
|
||||
the first non-none result. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.find_map">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_find" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2729-2734">source</a></span><a href="#method.try_find" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find" class="fnname">try_find</a><F, R>(<br> &mut self, <br> f: F<br>) -> <<R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html#associatedtype.TryType" title="type core::ops::try_trait::Residual::TryType">TryType</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a><Output = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>>,<br> <R as <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html" title="trait core::ops::try_trait::Try">Try</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Try.html#associatedtype.Residual" title="type core::ops::try_trait::Try::Residual">Residual</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/try_trait/trait.Residual.html" title="trait core::ops::try_trait::Residual">Residual</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>try_find</code>)</div></span><div class='docblock'><p>Applies function to the elements of iterator and returns
|
||||
the first true result or the first error. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.try_find">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.position" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2811-2814">source</a></span><a href="#method.position" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position" class="fnname">position</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element in an iterator, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.position">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.rposition" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2868-2871">source</a></span><a href="#method.rposition" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition" class="fnname">rposition</a><P>(&mut self, predicate: P) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/exact_size/trait.ExactSizeIterator.html" title="trait core::iter::traits::exact_size::ExactSizeIterator">ExactSizeIterator</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>, </span></h4></section></summary><div class='docblock'><p>Searches for an element in an iterator from the right, returning its
|
||||
index. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rposition">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2919-2922">source</a></span><a href="#method.max" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max" class="fnname">max</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p>Returns the maximum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2957-2960">source</a></span><a href="#method.min" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min" class="fnname">min</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p>Returns the minimum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max_by_key" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#2979-2982">source</a></span><a href="#method.max_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key" class="fnname">max_by_key</a><B, F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the maximum value from the
|
||||
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by_key">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.max_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3012-3015">source</a></span><a href="#method.max_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by" class="fnname">max_by</a><F>(self, compare: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the maximum value with respect to the
|
||||
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.max_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min_by_key" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.6.0">1.6.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3039-3042">source</a></span><a href="#method.min_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key" class="fnname">min_by_key</a><B, F>(self, f: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> B, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the minimum value from the
|
||||
specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by_key">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.min_by" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.15.0">1.15.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3072-3075">source</a></span><a href="#method.min_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by" class="fnname">min_by</a><F>(self, compare: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><div class='docblock'><p>Returns the element that gives the minimum value with respect to the
|
||||
specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.min_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.rev" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3109-3111">source</a></span><a href="#method.rev" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev" class="fnname">rev</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a><Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/double_ended/trait.DoubleEndedIterator.html" title="trait core::iter::traits::double_ended::DoubleEndedIterator">DoubleEndedIterator</a>, </span></h4></section></summary><div class='docblock'><p>Reverses an iterator’s direction. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.rev">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.unzip" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3147-3151">source</a></span><a href="#method.unzip" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip" class="fnname">unzip</a><A, B, FromA, FromB>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>FromA, FromB<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> FromA: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><A>,<br> FromB: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.Extend.html" title="trait core::iter::traits::collect::Extend">Extend</a><B>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a>A, B<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a>>, </span></h4></section></summary><div class='docblock'><p>Converts an iterator of pairs into a pair of containers. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.unzip">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.copied" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.36.0">1.36.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3179-3182">source</a></span><a href="#method.copied" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied" class="fnname">copied</a><'a, T>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/copied/struct.Copied.html" title="struct core::iter::adapters::copied::Copied">Copied</a><Self> <span class="where fmt-newline">where<br> T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a </a>T>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which copies all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.copied">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cloned" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3226-3229">source</a></span><a href="#method.cloned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned" class="fnname">cloned</a><'a, T>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cloned/struct.Cloned.html" title="struct core::iter::adapters::cloned::Cloned">Cloned</a><Self> <span class="where fmt-newline">where<br> T: 'a + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&'a </a>T>, </span></h4></section></summary><div class='docblock'><p>Creates an iterator which <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone"><code>clone</code></a>s all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cloned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cycle" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3260-3262">source</a></span><a href="#method.cycle" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle" class="fnname">cycle</a>(self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/iter/adapters/cycle/struct.Cycle.html" title="struct core::iter::adapters::cycle::Cycle">Cycle</a><Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h4></section></summary><div class='docblock'><p>Repeats an iterator endlessly. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cycle">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sum" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3290-3293">source</a></span><a href="#method.sum" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum" class="fnname">sum</a><S>(self) -> S <span class="where fmt-newline">where<br> S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Sum.html" title="trait core::iter::traits::accum::Sum">Sum</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Sums the elements of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.sum">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.product" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.11.0">1.11.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3319-3322">source</a></span><a href="#method.product" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product" class="fnname">product</a><P>(self) -> P <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/accum/trait.Product.html" title="trait core::iter::traits::accum::Product">Product</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Iterates over the entire iterator, multiplying all the elements <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.product">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3340-3344">source</a></span><a href="#method.cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp" class="fnname">cmp</a><I>(self, other: I) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html" title="trait core::cmp::Ord">Ord</a>, </span></h4></section></summary><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.cmp_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3369-3373">source</a></span><a href="#method.cmp_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by" class="fnname">cmp_by</a><I, F>(self, other: I, cmp: F) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.cmp_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3416-3420">source</a></span><a href="#method.partial_cmp" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp" class="fnname">partial_cmp</a><I>(self, other: I) -> <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="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.partial_cmp_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3454-3458">source</a></span><a href="#method.partial_cmp_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by" class="fnname">partial_cmp_by</a><I, F>(self, other: I, partial_cmp: F) -> <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="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</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="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p><a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">Lexicographically</a> compares the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> with those
|
||||
of another with respect to the specified comparison function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.partial_cmp_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3496-3500">source</a></span><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq" class="fnname">eq</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
|
||||
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3521-3525">source</a></span><a href="#method.eq_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by" class="fnname">eq_by</a><I, F>(self, other: I, eq: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>iter_order_by</code>)</div></span><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are equal to those of
|
||||
another with respect to the specified equality function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.eq_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3556-3560">source</a></span><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne" class="fnname">ne</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are unequal to those of
|
||||
another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ne">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3577-3581">source</a></span><a href="#method.lt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt" class="fnname">lt</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
less than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.lt">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.le" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3598-3602">source</a></span><a href="#method.le" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le" class="fnname">le</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
less or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.le">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.gt" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3619-3623">source</a></span><a href="#method.gt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt" class="fnname">gt</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
greater than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.gt">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ge" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.5.0">1.5.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3640-3644">source</a></span><a href="#method.ge" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge" class="fnname">ge</a><I>(self, other: I) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>,<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><<I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>>, </span></h4></section></summary><div class='docblock'><p>Determines if the elements of this <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="Iterator"><code>Iterator</code></a> are <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#lexicographical-comparison">lexicographically</a>
|
||||
greater than or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.ge">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3671-3674">source</a></span><a href="#method.is_sorted" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted" class="fnname">is_sorted</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted_by" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3699-3702">source</a></span><a href="#method.is_sorted_by" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by" class="fnname">is_sorted_by</a><F>(self, compare: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>, &Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</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="enum" href="https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html" title="enum core::cmp::Ordering">Ordering</a>>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted using the given comparator function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_sorted_by_key" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/iterator.rs.html#3745-3749">source</a></span><a href="#method.is_sorted_by_key" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key" class="fnname">is_sorted_by_key</a><F, K>(self, f: F) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>) -> K,<br> K: <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html" title="trait core::cmp::PartialOrd">PartialOrd</a><K>, </span></h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>is_sorted</code>)</div></span><div class='docblock'><p>Checks if the elements of this iterator are sorted using the given key extraction
|
||||
function. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#method.is_sorted_by_key">Read more</a></p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">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.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">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.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">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.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">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.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">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.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-IntoIterator" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#271-279">source</a></span><a href="#impl-IntoIterator" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Item-1" class="type trait-impl has-srclink"><a href="#associatedtype.Item-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" class="associatedtype">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a></h4></section></summary><div class='docblock'><p>The type of the elements being iterated over.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.IntoIter" class="type trait-impl has-srclink"><a href="#associatedtype.IntoIter" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" class="associatedtype">IntoIter</a> = I</h4></section></summary><div class='docblock'><p>Which kind of iterator are we turning this into?</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_iter" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/iter/traits/collect.rs.html#276">source</a></span><a href="#method.into_iter" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter" class="fnname">into_iter</a>(self) -> I</h4></section></summary><div class='docblock'><p>Creates an iterator from a value. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,35 @@
|
||||
<!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="An intrusive linked list"><meta name="keywords" content="rust, rustlang, rust-lang, LinkedList"><title>LinkedList in buddy_system_allocator::linked_list - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">LinkedList</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.is_empty">is_empty</a></li><li><a href="#method.iter">iter</a></li><li><a href="#method.iter_mut">iter_mut</a></li><li><a href="#method.new">new</a></li><li><a href="#method.pop">pop</a></li><li><a href="#method.push">push</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Clone">Clone</a></li><li><a href="#impl-Copy">Copy</a></li><li><a href="#impl-Debug">Debug</a></li><li><a href="#impl-Send">Send</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-ToOwned">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator::linked_list</a></h2><div id="sidebar-vars" data-name="LinkedList" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../buddy_system_allocator/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../index.html">buddy_system_allocator</a>::<wbr><a href="index.html">linked_list</a>::<wbr><a class="struct" href="#">LinkedList</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#13-15">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct LinkedList { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An intrusive linked list</p>
|
||||
<p>A clean room implementation of the one used in CS140e 2018 Winter</p>
|
||||
<p>Thanks Sergio Benitez for his excellent work,
|
||||
See <a href="https://cs140e.sergio.bz/">CS140e</a> for more information</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#19-67">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#21-25">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>() -> <a class="struct" href="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h4></section></summary><div class="docblock"><p>Create a new LinkedList</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_empty" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#28-30">source</a></span><a href="#method.is_empty" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_empty" class="fnname">is_empty</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Return <code>true</code> if the list is empty</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.push" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#33-36">source</a></span><a href="#method.push" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.push" class="fnname">push</a>(&mut self, item: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Push <code>item</code> to the front of the list</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.pop" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#39-49">source</a></span><a href="#method.pop" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.pop" class="fnname">pop</a>(&mut 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="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Try to remove the first item in the list</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.iter" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#52-57">source</a></span><a href="#method.iter" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.iter" class="fnname">iter</a>(&self) -> <a class="struct" href="struct.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'_><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></span><code class="content"><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.Iter.html" title="struct buddy_system_allocator::linked_list::Iter">Iter</a><'a></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Return an iterator over the items in the list</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.iter_mut" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#60-66">source</a></span><a href="#method.iter_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.iter_mut" class="fnname">iter_mut</a>(&mut self) -> <a class="struct" href="struct.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'_><span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<span class="notable-traits-tooltiptext"><span class="docblock"><span class="notable">Notable traits for <a class="struct" href="struct.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></span><code class="content"><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="struct" href="struct.IterMut.html" title="struct buddy_system_allocator::linked_list::IterMut">IterMut</a><'a></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="associatedtype">Item</a> = <a class="struct" href="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a>;</span></code></span></span></span></span></h4></section></summary><div class="docblock"><p>Return an mutable iterator over the items in the list</p>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#12">source</a></span><a href="#impl-Clone" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#12">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&self) -> <a class="struct" href="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#133-135">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#69-73">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header 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="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#70-72">source</a></span><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="fnname">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'><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></details></div></details><section id="impl-Copy" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#12">source</a></span><a href="#impl-Copy" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="struct" href="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section><section id="impl-Send" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#17">source</a></span><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.LinkedList.html" title="struct buddy_system_allocator::linked_list::LinkedList">LinkedList</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#84-96">source</a></span><a href="#impl-ToOwned" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="type trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'><p>The resulting type after obtaining ownership.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89">source</a></span><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&self) -> T</h4></section></summary><div class='docblock'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#93">source</a></span><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&self, target: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T)</h4></section></summary><span class="item-info"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</div></span><div class='docblock'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
22
ch6/buddy_system_allocator/linked_list/struct.ListNode.html
Normal file
22
ch6/buddy_system_allocator/linked_list/struct.ListNode.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!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="Represent a mutable node in `LinkedList`"><meta name="keywords" content="rust, rustlang, rust-lang, ListNode"><title>ListNode in buddy_system_allocator::linked_list - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">ListNode</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.pop">pop</a></li><li><a href="#method.value">value</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">!Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator::linked_list</a></h2><div id="sidebar-vars" data-name="ListNode" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../buddy_system_allocator/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../index.html">buddy_system_allocator</a>::<wbr><a href="index.html">linked_list</a>::<wbr><a class="struct" href="#">ListNode</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#97-100">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct ListNode { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Represent a mutable node in <code>LinkedList</code></p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#102-116">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.pop" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#104-110">source</a></span><a href="#method.pop" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.pop" class="fnname">pop</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Remove the node from the list</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.value" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/buddy_system_allocator/linked_list.rs.html#113-115">source</a></span><a href="#method.value" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.value" class="fnname">value</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the pointed address</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.ListNode.html" title="struct buddy_system_allocator::linked_list::ListNode">ListNode</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/buddy_system_allocator/sidebar-items.js
Normal file
1
ch6/buddy_system_allocator/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"mod":[["linked_list","Provide the intrusive LinkedList"]],"struct":[["FrameAllocator","A frame allocator that uses buddy system, requiring a global allocator"],["Heap","A heap that uses buddy system"],["LockedFrameAllocator","A locked version of `FrameAllocator`"],["LockedHeap","A locked version of `Heap`"],["LockedHeapWithRescue","A locked version of `Heap` with rescue before oom"]]});
|
39
ch6/buddy_system_allocator/struct.FrameAllocator.html
Normal file
39
ch6/buddy_system_allocator/struct.FrameAllocator.html
Normal file
@ -0,0 +1,39 @@
|
||||
<!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 frame allocator that uses buddy system, requiring a global allocator"><meta name="keywords" content="rust, rustlang, rust-lang, FrameAllocator"><title>FrameAllocator in buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">FrameAllocator</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.add_frame">add_frame</a></li><li><a href="#method.alloc">alloc</a></li><li><a href="#method.dealloc">dealloc</a></li><li><a href="#method.insert">insert</a></li><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator</a></h2><div id="sidebar-vars" data-name="FrameAllocator" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">buddy_system_allocator</a>::<wbr><a class="struct" href="#">FrameAllocator</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#28-35">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct FrameAllocator { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A frame allocator that uses buddy system,
|
||||
requiring a global allocator</p>
|
||||
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
||||
<p>Create a frame allocator and add some frames to it:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">buddy_system_allocator</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">frame</span> <span class="op">=</span> <span class="ident">FrameAllocator::new</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">frame</span>.<span class="ident">alloc</span>(<span class="number">1</span>).<span class="ident">is_none</span>());
|
||||
|
||||
<span class="ident">frame</span>.<span class="ident">add_frame</span>(<span class="number">0</span>, <span class="number">3</span>);
|
||||
<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">frame</span>.<span class="ident">alloc</span>(<span class="number">1</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">num</span>, <span class="prelude-val">Some</span>(<span class="number">2</span>));
|
||||
<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">frame</span>.<span class="ident">alloc</span>(<span class="number">2</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">num</span>, <span class="prelude-val">Some</span>(<span class="number">0</span>));</code></pre></div>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#37-134">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#39-45">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Create an empty frame allocator</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.add_frame" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#48-68">source</a></span><a href="#method.add_frame" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.add_frame" class="fnname">add_frame</a>(&mut self, start: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, end: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Add a range of frame number [start, end) to the allocator</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#71-73">source</a></span><a href="#method.insert" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>(&mut self, range: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ops/range/struct.Range.html" title="struct core::ops::range::Range">Range</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>>)</h4></section></summary><div class="docblock"><p>Add a range of frame to the allocator</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#76-106">source</a></span><a href="#method.alloc" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.alloc" class="fnname">alloc</a>(&mut self, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</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="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>></h4></section></summary><div class="docblock"><p>Alloc a range of frames from the allocator, return the first frame of the allocated range</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.dealloc" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#110-133">source</a></span><a href="#method.dealloc" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.dealloc" class="fnname">dealloc</a>(&mut self, frame: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, count: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Dealloc a range of frames [frame, frame+count) from the frame allocator.
|
||||
The range should be exactly the same when it was allocated, as in heap allocator</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
40
ch6/buddy_system_allocator/struct.Heap.html
Normal file
40
ch6/buddy_system_allocator/struct.Heap.html
Normal file
@ -0,0 +1,40 @@
|
||||
<!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 heap that uses buddy system"><meta name="keywords" content="rust, rustlang, rust-lang, Heap"><title>Heap in buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Heap</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.add_to_heap">add_to_heap</a></li><li><a href="#method.alloc">alloc</a></li><li><a href="#method.dealloc">dealloc</a></li><li><a href="#method.empty">empty</a></li><li><a href="#method.init">init</a></li><li><a href="#method.new">new</a></li><li><a href="#method.stats_alloc_actual">stats_alloc_actual</a></li><li><a href="#method.stats_alloc_user">stats_alloc_user</a></li><li><a href="#method.stats_total_bytes">stats_total_bytes</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Debug">Debug</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">!Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator</a></h2><div id="sidebar-vars" data-name="Heap" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">buddy_system_allocator</a>::<wbr><a class="struct" href="#">Heap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#49-57">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct Heap { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A heap that uses buddy system</p>
|
||||
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
||||
<p>Create a heap and add a memory region to it:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">buddy_system_allocator</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">heap</span> <span class="op">=</span> <span class="ident">Heap::empty</span>();
|
||||
<span class="kw">unsafe</span> {
|
||||
<span class="ident">heap</span>.<span class="ident">init</span>(<span class="ident">begin</span>, <span class="ident">size</span>);
|
||||
<span class="comment">// or</span>
|
||||
<span class="ident">heap</span>.<span class="ident">add_to_heap</span>(<span class="ident">begin</span>, <span class="ident">end</span>);
|
||||
}</code></pre></div>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#59-199">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#61-68">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>() -> Self</h4></section></summary><div class="docblock"><p>Create an empty heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.empty" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#71-73">source</a></span><a href="#method.empty" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.empty" class="fnname">empty</a>() -> Self</h4></section></summary><div class="docblock"><p>Create an empty heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.add_to_heap" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#76-95">source</a></span><a href="#method.add_to_heap" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.add_to_heap" class="fnname">add_to_heap</a>(&mut self, start: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, end: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Add a range of memory [start, end) to the heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.init" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#98-100">source</a></span><a href="#method.init" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.init" class="fnname">init</a>(&mut self, start: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>)</h4></section></summary><div class="docblock"><p>Add a range of memory [start, end) to the heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#103-141">source</a></span><a href="#method.alloc" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.alloc" class="fnname">alloc</a>(&mut self, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>></h4></section></summary><div class="docblock"><p>Alloc a range of memory from the heap satifying <code>layout</code> requirements</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.dealloc" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#144-183">source</a></span><a href="#method.dealloc" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.dealloc" class="fnname">dealloc</a>(&mut self, ptr: <a class="struct" href="https://doc.rust-lang.org/nightly/core/ptr/non_null/struct.NonNull.html" title="struct core::ptr::non_null::NonNull">NonNull</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>>, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>)</h4></section></summary><div class="docblock"><p>Dealloc a range of memory from the heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.stats_alloc_user" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#186-188">source</a></span><a href="#method.stats_alloc_user" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.stats_alloc_user" class="fnname">stats_alloc_user</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the number of bytes that user requests</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.stats_alloc_actual" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#191-193">source</a></span><a href="#method.stats_alloc_actual" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.stats_alloc_actual" class="fnname">stats_alloc_actual</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the number of bytes that are actually allocated</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.stats_total_bytes" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#196-198">source</a></span><a href="#method.stats_total_bytes" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.stats_total_bytes" class="fnname">stats_total_bytes</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Return the total number of bytes in the heap</p>
|
||||
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#201-209">source</a></span><a href="#impl-Debug" class="anchor"></a><h3 class="code-header 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="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#202-208">source</a></span><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="fnname">fmt</a>(&self, fmt: &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'><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></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
65
ch6/buddy_system_allocator/struct.LockedFrameAllocator.html
Normal file
65
ch6/buddy_system_allocator/struct.LockedFrameAllocator.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!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 locked version of `FrameAllocator`"><meta name="keywords" content="rust, rustlang, rust-lang, LockedFrameAllocator"><title>LockedFrameAllocator in buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">LockedFrameAllocator</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#deref-methods-Mutex%3CFrameAllocator%3E">Methods from Deref<Target=Mutex<FrameAllocator>></a></h3><ul><li><a href="#method.force_unlock">force_unlock</a></li><li><a href="#method.is_locked">is_locked</a></li><li><a href="#method.lock">lock</a></li><li><a href="#method.try_lock">try_lock</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Deref">Deref</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator</a></h2><div id="sidebar-vars" data-name="LockedFrameAllocator" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">buddy_system_allocator</a>::<wbr><a class="struct" href="#">LockedFrameAllocator</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#153">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct LockedFrameAllocator(_);</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A locked version of <code>FrameAllocator</code></p>
|
||||
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
||||
<p>Create a locked frame allocator and add frames to it:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">buddy_system_allocator</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">frame</span> <span class="op">=</span> <span class="ident">LockedFrameAllocator::new</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">frame</span>.<span class="ident">lock</span>().<span class="ident">alloc</span>(<span class="number">1</span>).<span class="ident">is_none</span>());
|
||||
|
||||
<span class="ident">frame</span>.<span class="ident">lock</span>().<span class="ident">add_frame</span>(<span class="number">0</span>, <span class="number">3</span>);
|
||||
<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">frame</span>.<span class="ident">lock</span>().<span class="ident">alloc</span>(<span class="number">1</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">num</span>, <span class="prelude-val">Some</span>(<span class="number">2</span>));
|
||||
<span class="kw">let</span> <span class="ident">num</span> <span class="op">=</span> <span class="ident">frame</span>.<span class="ident">lock</span>().<span class="ident">alloc</span>(<span class="number">2</span>);
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">num</span>, <span class="prelude-val">Some</span>(<span class="number">0</span>));</code></pre></div>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#156-161">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#158-160">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -> <a class="struct" href="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h4></section></summary><div class="docblock"><p>Creates an empty heap</p>
|
||||
</div></details></div></details></div><h2 id="deref-methods-Mutex%3CFrameAllocator%3E" class="small-section-header"><span>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><Target = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a>>></span><a href="#deref-methods-Mutex%3CFrameAllocator%3E" class="anchor"></a></h2><div id="deref-methods-Mutex%3CFrameAllocator%3E-1"><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_locked" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#153">source</a></span><a href="#method.is_locked" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the lock is currently held.</p>
|
||||
<h5 id="safety"><a href="#safety">Safety</a></h5>
|
||||
<p>This function provides no synchronization guarantees and so its result should be considered ‘out of date’
|
||||
the instant it is called. Do not use it for synchronization purposes. However, it may be useful as a heuristic.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#172">source</a></span><a href="#method.lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&self) -> <a class="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T></h4></section></summary><div class="docblock"><p>Locks the <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a> and returns a guard that permits access to the inner data.</p>
|
||||
<p>The returned value may be dereferenced for data access
|
||||
and the lock will be dropped when the guard falls out of scope.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">0</span>);
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>();
|
||||
<span class="comment">// The lock is now locked and the data can be accessed</span>
|
||||
<span class="kw-2">*</span><span class="ident">data</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// The lock is implicitly dropped at the end of the scope</span>
|
||||
}</code></pre></div>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.force_unlock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#186">source</a></span><a href="#method.force_unlock" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock" class="fnname">force_unlock</a>(&self)</h4></section></summary><div class="docblock"><p>Force unlock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>.</p>
|
||||
<h5 id="safety-1"><a href="#safety-1">Safety</a></h5>
|
||||
<p>This is <em>extremely</em> unsafe if the lock is not held by the current
|
||||
thread. However, this can be useful in some instances for exposing the
|
||||
lock to FFI that doesn’t know how to deal with RAII.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#205">source</a></span><a href="#method.try_lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</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="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T>></h4></section></summary><div class="docblock"><p>Try to lock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>, returning a lock guard if successful.</p>
|
||||
<h5 id="example"><a href="#example">Example</a></h5>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">42</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard</span>.<span class="ident">is_some</span>());
|
||||
|
||||
<span class="comment">// `maybe_guard` is still held, so the second call fails</span>
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard2</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard2</span>.<span class="ident">is_none</span>());</code></pre></div>
|
||||
</div></details></div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deref" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#164-170">source</a></span><a href="#impl-Deref" class="anchor"></a><h3 class="code-header 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="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a>></h4></section></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/frame.rs.html#167-169">source</a></span><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.FrameAllocator.html" title="struct buddy_system_allocator::FrameAllocator">FrameAllocator</a>></h4></section></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.LockedFrameAllocator.html" title="struct buddy_system_allocator::LockedFrameAllocator">LockedFrameAllocator</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
70
ch6/buddy_system_allocator/struct.LockedHeap.html
Normal file
70
ch6/buddy_system_allocator/struct.LockedHeap.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!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 locked version of `Heap`"><meta name="keywords" content="rust, rustlang, rust-lang, LockedHeap"><title>LockedHeap in buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">LockedHeap</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.empty">empty</a></li><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#deref-methods-Mutex%3CHeap%3E">Methods from Deref<Target=Mutex<Heap>></a></h3><ul><li><a href="#method.force_unlock">force_unlock</a></li><li><a href="#method.is_locked">is_locked</a></li><li><a href="#method.lock">lock</a></li><li><a href="#method.try_lock">try_lock</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Deref">Deref</a></li><li><a href="#impl-GlobalAlloc">GlobalAlloc</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator</a></h2><div id="sidebar-vars" data-name="LockedHeap" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">buddy_system_allocator</a>::<wbr><a class="struct" href="#">LockedHeap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#231">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct LockedHeap(_);</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A locked version of <code>Heap</code></p>
|
||||
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
||||
<p>Create a locked heap and add a memory region to it:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">buddy_system_allocator</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">heap</span> <span class="op">=</span> <span class="ident">LockedHeap::new</span>();
|
||||
<span class="kw">unsafe</span> {
|
||||
<span class="ident">heap</span>.<span class="ident">lock</span>().<span class="ident">init</span>(<span class="ident">begin</span>, <span class="ident">size</span>);
|
||||
<span class="comment">// or</span>
|
||||
<span class="ident">heap</span>.<span class="ident">lock</span>().<span class="ident">add_to_heap</span>(<span class="ident">begin</span>, <span class="ident">end</span>);
|
||||
}</code></pre></div>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#234-244">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#236-238">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.new" class="fnname">new</a>() -> <a class="struct" href="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h4></section></summary><div class="docblock"><p>Creates an empty heap</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.empty" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#241-243">source</a></span><a href="#method.empty" class="anchor"></a><h4 class="code-header">pub const fn <a href="#method.empty" class="fnname">empty</a>() -> <a class="struct" href="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h4></section></summary><div class="docblock"><p>Creates an empty heap</p>
|
||||
</div></details></div></details></div><h2 id="deref-methods-Mutex%3CHeap%3E" class="small-section-header"><span>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><Target = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>>></span><a href="#deref-methods-Mutex%3CHeap%3E" class="anchor"></a></h2><div id="deref-methods-Mutex%3CHeap%3E-1"><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_locked" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#153">source</a></span><a href="#method.is_locked" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the lock is currently held.</p>
|
||||
<h5 id="safety"><a href="#safety">Safety</a></h5>
|
||||
<p>This function provides no synchronization guarantees and so its result should be considered ‘out of date’
|
||||
the instant it is called. Do not use it for synchronization purposes. However, it may be useful as a heuristic.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#172">source</a></span><a href="#method.lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&self) -> <a class="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T></h4></section></summary><div class="docblock"><p>Locks the <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a> and returns a guard that permits access to the inner data.</p>
|
||||
<p>The returned value may be dereferenced for data access
|
||||
and the lock will be dropped when the guard falls out of scope.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">0</span>);
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>();
|
||||
<span class="comment">// The lock is now locked and the data can be accessed</span>
|
||||
<span class="kw-2">*</span><span class="ident">data</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// The lock is implicitly dropped at the end of the scope</span>
|
||||
}</code></pre></div>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.force_unlock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#186">source</a></span><a href="#method.force_unlock" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock" class="fnname">force_unlock</a>(&self)</h4></section></summary><div class="docblock"><p>Force unlock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>.</p>
|
||||
<h5 id="safety-1"><a href="#safety-1">Safety</a></h5>
|
||||
<p>This is <em>extremely</em> unsafe if the lock is not held by the current
|
||||
thread. However, this can be useful in some instances for exposing the
|
||||
lock to FFI that doesn’t know how to deal with RAII.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#205">source</a></span><a href="#method.try_lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</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="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T>></h4></section></summary><div class="docblock"><p>Try to lock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>, returning a lock guard if successful.</p>
|
||||
<h5 id="example"><a href="#example">Example</a></h5>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">42</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard</span>.<span class="ident">is_some</span>());
|
||||
|
||||
<span class="comment">// `maybe_guard` is still held, so the second call fails</span>
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard2</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard2</span>.<span class="ident">is_none</span>());</code></pre></div>
|
||||
</div></details></div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deref" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#247-253">source</a></span><a href="#impl-Deref" class="anchor"></a><h3 class="code-header 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="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>></h4></section></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#250-252">source</a></span><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>></h4></section></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-GlobalAlloc" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#256-268">source</a></span><a href="#impl-GlobalAlloc" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html" title="trait core::alloc::global::GlobalAlloc">GlobalAlloc</a> for <a class="struct" href="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#257-263">source</a></span><a href="#method.alloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.alloc" class="fnname">alloc</a>(&self, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Allocate memory as described by the given <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.alloc">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.dealloc" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#265-267">source</a></span><a href="#method.dealloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.dealloc" class="fnname">dealloc</a>(&self, ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>)</h4></section></summary><div class='docblock'><p>Deallocate the block of memory at the given <code>ptr</code> pointer with the given <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.dealloc">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc_zeroed" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/alloc/global.rs.html#194">source</a></span><a href="#method.alloc_zeroed" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.alloc_zeroed" class="fnname">alloc_zeroed</a>(&self, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Behaves like <code>alloc</code>, but also ensures that the contents
|
||||
are set to zero before being returned. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.alloc_zeroed">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.realloc" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/alloc/global.rs.html#261">source</a></span><a href="#method.realloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.realloc" class="fnname">realloc</a>(<br> &self, <br> ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>, <br> new_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Shrink or grow a block of memory to the given <code>new_size</code>.
|
||||
The block is described by the given <code>ptr</code> pointer and <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.realloc">Read more</a></p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.LockedHeap.html" title="struct buddy_system_allocator::LockedHeap">LockedHeap</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
65
ch6/buddy_system_allocator/struct.LockedHeapWithRescue.html
Normal file
65
ch6/buddy_system_allocator/struct.LockedHeapWithRescue.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!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 locked version of `Heap` with rescue before oom"><meta name="keywords" content="rust, rustlang, rust-lang, LockedHeapWithRescue"><title>LockedHeapWithRescue in buddy_system_allocator - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../buddy_system_allocator/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">LockedHeapWithRescue</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.new">new</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#deref-methods-Mutex%3CHeap%3E">Methods from Deref<Target=Mutex<Heap>></a></h3><ul><li><a href="#method.force_unlock">force_unlock</a></li><li><a href="#method.is_locked">is_locked</a></li><li><a href="#method.lock">lock</a></li><li><a href="#method.try_lock">try_lock</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Deref">Deref</a></li><li><a href="#impl-GlobalAlloc">GlobalAlloc</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In buddy_system_allocator</a></h2><div id="sidebar-vars" data-name="LockedHeapWithRescue" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../buddy_system_allocator/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">buddy_system_allocator</a>::<wbr><a class="struct" href="#">LockedHeapWithRescue</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#282-285">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct LockedHeapWithRescue { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A locked version of <code>Heap</code> with rescue before oom</p>
|
||||
<h2 id="usage"><a href="#usage">Usage</a></h2>
|
||||
<p>Create a locked heap:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">buddy_system_allocator</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">let</span> <span class="ident">heap</span> <span class="op">=</span> <span class="ident">LockedHeapWithRescue::new</span>(<span class="op">|</span><span class="ident">heap</span>: <span class="kw-2">&mut</span> <span class="ident">Heap</span><span class="op">|</span> {});</code></pre></div>
|
||||
<p>Before oom, the allocator will try to call rescue function and try for one more time.</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#288-306">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#300-305">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(rescue: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.fn.html">fn</a>(_: &mut <a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>)) -> <a class="struct" href="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h4></section></summary><div class="docblock"><p>Creates an empty heap</p>
|
||||
</div></details></div></details></div><h2 id="deref-methods-Mutex%3CHeap%3E" class="small-section-header"><span>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><Target = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>>></span><a href="#deref-methods-Mutex%3CHeap%3E" class="anchor"></a></h2><div id="deref-methods-Mutex%3CHeap%3E-1"><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.is_locked" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#153">source</a></span><a href="#method.is_locked" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns <code>true</code> if the lock is currently held.</p>
|
||||
<h5 id="safety"><a href="#safety">Safety</a></h5>
|
||||
<p>This function provides no synchronization guarantees and so its result should be considered ‘out of date’
|
||||
the instant it is called. Do not use it for synchronization purposes. However, it may be useful as a heuristic.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#172">source</a></span><a href="#method.lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&self) -> <a class="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T></h4></section></summary><div class="docblock"><p>Locks the <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a> and returns a guard that permits access to the inner data.</p>
|
||||
<p>The returned value may be dereferenced for data access
|
||||
and the lock will be dropped when the guard falls out of scope.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">0</span>);
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>();
|
||||
<span class="comment">// The lock is now locked and the data can be accessed</span>
|
||||
<span class="kw-2">*</span><span class="ident">data</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// The lock is implicitly dropped at the end of the scope</span>
|
||||
}</code></pre></div>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.force_unlock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#186">source</a></span><a href="#method.force_unlock" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock" class="fnname">force_unlock</a>(&self)</h4></section></summary><div class="docblock"><p>Force unlock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>.</p>
|
||||
<h5 id="safety-1"><a href="#safety-1">Safety</a></h5>
|
||||
<p>This is <em>extremely</em> unsafe if the lock is not held by the current
|
||||
thread. However, this can be useful in some instances for exposing the
|
||||
lock to FFI that doesn’t know how to deal with RAII.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_lock" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/spin/mutex.rs.html#205">source</a></span><a href="#method.try_lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</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="struct" href="../spin/mutex/struct.MutexGuard.html" title="struct spin::mutex::MutexGuard">MutexGuard</a><'_, T>></h4></section></summary><div class="docblock"><p>Try to lock this <a href="../spin/mutex/struct.Mutex.html" title="Mutex"><code>Mutex</code></a>, returning a lock guard if successful.</p>
|
||||
<h5 id="example"><a href="#example">Example</a></h5>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">42</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard</span>.<span class="ident">is_some</span>());
|
||||
|
||||
<span class="comment">// `maybe_guard` is still held, so the second call fails</span>
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard2</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard2</span>.<span class="ident">is_none</span>());</code></pre></div>
|
||||
</div></details></div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Deref" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#309-315">source</a></span><a href="#impl-Deref" class="anchor"></a><h3 class="code-header 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="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>></h4></section></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.deref" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#312-314">source</a></span><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.Heap.html" title="struct buddy_system_allocator::Heap">Heap</a>></h4></section></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-GlobalAlloc" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#318-338">source</a></span><a href="#impl-GlobalAlloc" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html" title="trait core::alloc::global::GlobalAlloc">GlobalAlloc</a> for <a class="struct" href="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#319-331">source</a></span><a href="#method.alloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.alloc" class="fnname">alloc</a>(&self, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Allocate memory as described by the given <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.alloc">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.dealloc" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/buddy_system_allocator/lib.rs.html#333-337">source</a></span><a href="#method.dealloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.dealloc" class="fnname">dealloc</a>(&self, ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>)</h4></section></summary><div class='docblock'><p>Deallocate the block of memory at the given <code>ptr</code> pointer with the given <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#tymethod.dealloc">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc_zeroed" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/alloc/global.rs.html#194">source</a></span><a href="#method.alloc_zeroed" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.alloc_zeroed" class="fnname">alloc_zeroed</a>(&self, layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Behaves like <code>alloc</code>, but also ensures that the contents
|
||||
are set to zero before being returned. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.alloc_zeroed">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.realloc" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.28.0">1.28.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/alloc/global.rs.html#261">source</a></span><a href="#method.realloc" class="anchor"></a><h4 class="code-header">unsafe fn <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.realloc" class="fnname">realloc</a>(<br> &self, <br> ptr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> layout: <a class="struct" href="https://doc.rust-lang.org/nightly/core/alloc/layout/struct.Layout.html" title="struct core::alloc::layout::Layout">Layout</a>, <br> new_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a></h4></section></summary><div class='docblock'><p>Shrink or grow a block of memory to the given <code>new_size</code>.
|
||||
The block is described by the given <code>ptr</code> pointer and <code>layout</code>. <a href="https://doc.rust-lang.org/nightly/core/alloc/global/trait.GlobalAlloc.html#method.realloc">Read more</a></p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <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.LockedHeapWithRescue.html" title="struct buddy_system_allocator::LockedHeapWithRescue">LockedHeapWithRescue</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="buddy_system_allocator" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
7
ch6/cfg_if/all.html
Normal file
7
ch6/cfg_if/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate cfg_if</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.cfg_if.html">cfg_if</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
28
ch6/cfg_if/index.html
Normal file
28
ch6/cfg_if/index.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!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 macro for defining `#[cfg]` if-else statements."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate cfg_if</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 1.0.0</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#macros">Macros</a></li></ul></div></section><div id="sidebar-vars" data-name="cfg_if" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">cfg_if</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/cfg_if/lib.rs.html#1-176">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A macro for defining <code>#[cfg]</code> if-else statements.</p>
|
||||
<p>The macro provided by this crate, <code>cfg_if</code>, is similar to the <code>if/elif</code> C
|
||||
preprocessor macro by allowing definition of a cascade of <code>#[cfg]</code> cases,
|
||||
emitting the implementation which matches first.</p>
|
||||
<p>This allows you to conveniently provide a long list <code>#[cfg]</code>’d blocks of code
|
||||
without having to rewrite each clause multiple times.</p>
|
||||
<h2 id="example"><a href="#example">Example</a></h2>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">cfg_if::cfg_if!</span> {
|
||||
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">unix</span>)]</span> {
|
||||
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* unix specific functionality */</span> }
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_pointer_width</span> <span class="op">=</span> <span class="string">"32"</span>)]</span> {
|
||||
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* non-unix, 32-bit functionality */</span> }
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* fallback implementation */</span> }
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</div></details><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.cfg_if.html" title="cfg_if::cfg_if macro">cfg_if</a></div><div class="item-right docblock-short"><p>The main macro provided by this crate. See crate documentation for more
|
||||
information.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/cfg_if/macro.cfg_if!.html
Normal file
11
ch6/cfg_if/macro.cfg_if!.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=macro.cfg_if.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="macro.cfg_if.html">macro.cfg_if.html</a>...</p>
|
||||
<script>location.replace("macro.cfg_if.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
26
ch6/cfg_if/macro.cfg_if.html
Normal file
26
ch6/cfg_if/macro.cfg_if.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!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="The main macro provided by this crate. See crate documentation for more information."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if in cfg_if - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In cfg_if</a></h2><div id="sidebar-vars" data-name="cfg_if" data-ty="macro" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Macro <a href="index.html">cfg_if</a>::<wbr><a class="macro" href="#">cfg_if</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/cfg_if/lib.rs.html#34-87">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><div class="example-wrap"><pre class="rust macro"><code><span class="macro">macro_rules!</span> <span class="ident">cfg_if</span> {
|
||||
($(
|
||||
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">meta</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
|
||||
) <span class="kw">else</span> <span class="op">*</span> <span class="kw">else</span> {
|
||||
$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens2</span>:<span class="ident">tt</span>)<span class="op">*</span>
|
||||
}) => { ... };
|
||||
(
|
||||
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
|
||||
$(
|
||||
<span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
|
||||
)<span class="op">*</span>
|
||||
) => { ... };
|
||||
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ) => { ... };
|
||||
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ( ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">m</span>:<span class="ident">meta</span>),<span class="kw-2">*</span>) ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) ), $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">rest</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) => { ... };
|
||||
(@<span class="ident">__identity</span> $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) => { ... };
|
||||
}</code></pre></div>
|
||||
</div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The main macro provided by this crate. See crate documentation for more
|
||||
information.</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/cfg_if/sidebar-items.js
Normal file
1
ch6/cfg_if/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"macro":[["cfg_if","The main macro provided by this crate. See crate documentation for more information."]]});
|
@ -1 +1 @@
|
||||
window.ALL_CRATES = ["os"];
|
||||
window.ALL_CRATES = ["bare_metal","bit_field","bitflags","buddy_system_allocator","cfg_if","easy_fs","embedded_hal","k210_hal","k210_pac","k210_soc","lazy_static","log","os","riscv","spin","vcell","virtio_drivers","volatile","xmas_elf","zero"];
|
7
ch6/easy_fs/all.html
Normal file
7
ch6/easy_fs/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate easy_fs</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.EasyFileSystem.html">EasyFileSystem</a></li><li><a href="struct.Inode.html">Inode</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.BlockDevice.html">BlockDevice</a></li></ul><h3 id="Constants">Constants</h3><ul class="constants docblock"><li><a href="constant.BLOCK_SZ.html">BLOCK_SZ</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/easy_fs/block_dev/trait.BlockDevice.html
Normal file
11
ch6/easy_fs/block_dev/trait.BlockDevice.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../easy_fs/trait.BlockDevice.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../easy_fs/trait.BlockDevice.html">../../easy_fs/trait.BlockDevice.html</a>...</p>
|
||||
<script>location.replace("../../easy_fs/trait.BlockDevice.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
9
ch6/easy_fs/constant.BLOCK_SZ.html
Normal file
9
ch6/easy_fs/constant.BLOCK_SZ.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!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="Use a block size of 512 bytes"><meta name="keywords" content="rust, rustlang, rust-lang, BLOCK_SZ"><title>BLOCK_SZ in easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In easy_fs</a></h2><div id="sidebar-vars" data-name="BLOCK_SZ" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="index.html">easy_fs</a>::<wbr><a class="constant" href="#">BLOCK_SZ</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/easy_fs/lib.rs.html#12">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BLOCK_SZ: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 512;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Use a block size of 512 bytes</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/easy_fs/efs/struct.EasyFileSystem.html
Normal file
11
ch6/easy_fs/efs/struct.EasyFileSystem.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../easy_fs/struct.EasyFileSystem.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../easy_fs/struct.EasyFileSystem.html">../../easy_fs/struct.EasyFileSystem.html</a>...</p>
|
||||
<script>location.replace("../../easy_fs/struct.EasyFileSystem.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
17
ch6/easy_fs/index.html
Normal file
17
ch6/easy_fs/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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="An easy file system isolated from the kernel"><meta name="keywords" content="rust, rustlang, rust-lang, easy_fs"><title>easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Crate easy_fs</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.1.0</li><li><a id="all-types" href="all.html">All Items</a></li></div></ul><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="easy_fs" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">easy_fs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/easy_fs/lib.rs.html#1-18">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An easy file system isolated from the kernel</p>
|
||||
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EasyFileSystem.html" title="easy_fs::EasyFileSystem struct">EasyFileSystem</a></div><div class="item-right docblock-short"><p>An easy file system on block</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Inode.html" title="easy_fs::Inode struct">Inode</a></div><div class="item-right docblock-short"><p>Virtual filesystem layer over easy-fs</p>
|
||||
</div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BLOCK_SZ.html" title="easy_fs::BLOCK_SZ constant">BLOCK_SZ</a></div><div class="item-right docblock-short"><p>Use a block size of 512 bytes</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.BlockDevice.html" title="easy_fs::BlockDevice trait">BlockDevice</a></div><div class="item-right docblock-short"><p>Trait for block devices
|
||||
which reads and writes data in the unit of blocks</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/easy_fs/sidebar-items.js
Normal file
1
ch6/easy_fs/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"constant":[["BLOCK_SZ","Use a block size of 512 bytes"]],"struct":[["EasyFileSystem","An easy file system on block"],["Inode","Virtual filesystem layer over easy-fs"]],"trait":[["BlockDevice","Trait for block devices which reads and writes data in the unit of blocks"]]});
|
37
ch6/easy_fs/struct.EasyFileSystem.html
Normal file
37
ch6/easy_fs/struct.EasyFileSystem.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!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="An easy file system on block"><meta name="keywords" content="rust, rustlang, rust-lang, EasyFileSystem"><title>EasyFileSystem in easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">EasyFileSystem</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><ul><li><a href="#structfield.block_device">block_device</a></li><li><a href="#structfield.data_bitmap">data_bitmap</a></li><li><a href="#structfield.inode_bitmap">inode_bitmap</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.alloc_data">alloc_data</a></li><li><a href="#method.alloc_inode">alloc_inode</a></li><li><a href="#method.create">create</a></li><li><a href="#method.dealloc_data">dealloc_data</a></li><li><a href="#method.get_data_block_id">get_data_block_id</a></li><li><a href="#method.get_disk_inode_pos">get_disk_inode_pos</a></li><li><a href="#method.open">open</a></li><li><a href="#method.root_inode">root_inode</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">!UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In easy_fs</a></h2><div id="sidebar-vars" data-name="EasyFileSystem" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">easy_fs</a>::<wbr><a class="struct" href="#">EasyFileSystem</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/easy_fs/efs.rs.html#9-18">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct EasyFileSystem {
|
||||
pub block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="trait.BlockDevice.html" title="trait easy_fs::BlockDevice">BlockDevice</a>>,
|
||||
pub inode_bitmap: Bitmap,
|
||||
pub data_bitmap: Bitmap,
|
||||
/* private fields */
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An easy file system on block</p>
|
||||
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.block_device" class="structfield small-section-header"><a href="#structfield.block_device" class="anchor field"></a><code>block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="trait.BlockDevice.html" title="trait easy_fs::BlockDevice">BlockDevice</a>></code></span><div class="docblock"><p>Real device</p>
|
||||
</div><span id="structfield.inode_bitmap" class="structfield small-section-header"><a href="#structfield.inode_bitmap" class="anchor field"></a><code>inode_bitmap: Bitmap</code></span><div class="docblock"><p>Inode bitmap</p>
|
||||
</div><span id="structfield.data_bitmap" class="structfield small-section-header"><a href="#structfield.data_bitmap" class="anchor field"></a><code>data_bitmap: Bitmap</code></span><div class="docblock"><p>Data bitmap</p>
|
||||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#22-151">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section></summary><div class="docblock"><p>An easy fs over a block device</p>
|
||||
</div><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.create" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#24-83">source</a></span><a href="#method.create" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.create" class="fnname">create</a>(<br> block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="trait.BlockDevice.html" title="trait easy_fs::BlockDevice">BlockDevice</a>>, <br> total_blocks: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>, <br> inode_bitmap_blocks: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><Self>></h4></section></summary><div class="docblock"><p>A data block of block size</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.open" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#85-105">source</a></span><a href="#method.open" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.open" class="fnname">open</a>(block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="trait.BlockDevice.html" title="trait easy_fs::BlockDevice">BlockDevice</a>>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><Self>></h4></section></summary><div class="docblock"><p>Open a block device as a filesystem</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.root_inode" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#107-113">source</a></span><a href="#method.root_inode" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.root_inode" class="fnname">root_inode</a>(efs: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><Self>>) -> <a class="struct" href="struct.Inode.html" title="struct easy_fs::Inode">Inode</a></h4></section></summary><div class="docblock"><p>Get the root inode of the filesystem</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_disk_inode_pos" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#115-123">source</a></span><a href="#method.get_disk_inode_pos" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_disk_inode_pos" class="fnname">get_disk_inode_pos</a>(&self, inode_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></h4></section></summary><div class="docblock"><p>Get inode by id</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_data_block_id" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#125-127">source</a></span><a href="#method.get_data_block_id" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_data_block_id" class="fnname">get_data_block_id</a>(&self, data_block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Get data block by id</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc_inode" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#129-131">source</a></span><a href="#method.alloc_inode" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.alloc_inode" class="fnname">alloc_inode</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Allocate a new inode</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.alloc_data" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#134-136">source</a></span><a href="#method.alloc_data" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.alloc_data" class="fnname">alloc_data</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>Allocate a data block</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.dealloc_data" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/efs.rs.html#138-150">source</a></span><a href="#method.dealloc_data" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.dealloc_data" class="fnname">dealloc_data</a>(&mut self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>)</h4></section></summary><div class="docblock"><p>Deallocate a data block</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
27
ch6/easy_fs/struct.Inode.html
Normal file
27
ch6/easy_fs/struct.Inode.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!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="Virtual filesystem layer over easy-fs"><meta name="keywords" content="rust, rustlang, rust-lang, Inode"><title>Inode in easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Inode</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.clear">clear</a></li><li><a href="#method.create">create</a></li><li><a href="#method.find">find</a></li><li><a href="#method.ls">ls</a></li><li><a href="#method.new">new</a></li><li><a href="#method.read_at">read_at</a></li><li><a href="#method.write_at">write_at</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a></li><li><a href="#impl-Send">Send</a></li><li><a href="#impl-Sync">Sync</a></li><li><a href="#impl-Unpin">Unpin</a></li><li><a href="#impl-UnwindSafe">!UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any">Any</a></li><li><a href="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><a href="#impl-From%3CT%3E">From<T></a></li><li><a href="#impl-Into%3CU%3E">Into<U></a></li><li><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><a href="#impl-TryInto%3CU%3E">TryInto<U></a></li></ul></div></section><h2 class="location"><a href="index.html">In easy_fs</a></h2><div id="sidebar-vars" data-name="Inode" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="index.html">easy_fs</a>::<wbr><a class="struct" href="#">Inode</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/easy_fs/vfs.rs.html#10-15">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct Inode { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Virtual filesystem layer over easy-fs</p>
|
||||
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#17-186">source</a></span><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#19-31">source</a></span><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(<br> block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>, <br> block_offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <br> fs: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../spin/mutex/struct.Mutex.html" title="struct spin::mutex::Mutex">Mutex</a><<a class="struct" href="struct.EasyFileSystem.html" title="struct easy_fs::EasyFileSystem">EasyFileSystem</a>>>, <br> block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="trait.BlockDevice.html" title="trait easy_fs::BlockDevice">BlockDevice</a>><br>) -> Self</h4></section></summary><div class="docblock"><p>Create a vfs inode</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.find" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#62-75">source</a></span><a href="#method.find" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.find" class="fnname">find</a>(&self, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</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="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Inode.html" title="struct easy_fs::Inode">Inode</a>>></h4></section></summary><div class="docblock"><p>Find inode under current inode by name</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.create" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#94-140">source</a></span><a href="#method.create" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.create" class="fnname">create</a>(&self, name: &<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.str.html">str</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="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="struct.Inode.html" title="struct easy_fs::Inode">Inode</a>>></h4></section></summary><div class="docblock"><p>Create inode under current inode by name</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ls" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#142-157">source</a></span><a href="#method.ls" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.ls" class="fnname">ls</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>></h4></section></summary><div class="docblock"><p>List inodes under current inode</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.read_at" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#159-162">source</a></span><a href="#method.read_at" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.read_at" class="fnname">read_at</a>(&self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Read data from current inode</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.write_at" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#164-172">source</a></span><a href="#method.write_at" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.write_at" class="fnname">write_at</a>(&self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Write data to current inode</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clear" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/easy_fs/vfs.rs.html#174-185">source</a></span><a href="#method.clear" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.clear" class="fnname">clear</a>(&self)</h4></section></summary><div class="docblock"><p>Clear the data in current inode</p>
|
||||
</div></details></div></details></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"><section id="impl-RefUnwindSafe" class="impl has-srclink"><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section><section id="impl-Send" class="impl has-srclink"><a href="#impl-Send" class="anchor"></a><h3 class="code-header 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="struct.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section><section id="impl-Sync" class="impl has-srclink"><a href="#impl-Sync" class="anchor"></a><h3 class="code-header 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="struct.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section><section id="impl-Unpin" class="impl has-srclink"><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header 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="struct.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section><section id="impl-UnwindSafe" class="impl has-srclink"><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<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.Inode.html" title="struct easy_fs::Inode">Inode</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136">source</a></span><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133">source</a></span><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="fnname">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'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214">source</a></span><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211">source</a></span><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="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222">source</a></span><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219">source</a></span><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="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></section></summary><div class='docblock'><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></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#557-562">source</a></span><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">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="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#559">source</a></span><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="fnname">from</a>(t: T) -> T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541-552">source</a></span><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549">source</a></span><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="fnname">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="From">From</a><T> for U</code> chooses to do.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#598-607">source</a></span><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#604">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#583-592">source</a></span><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">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 <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" 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'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589">source</a></span><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="fnname">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'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
15
ch6/easy_fs/trait.BlockDevice.html
Normal file
15
ch6/easy_fs/trait.BlockDevice.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!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="Trait for block devices which reads and writes data in the unit of blocks"><meta name="keywords" content="rust, rustlang, rust-lang, BlockDevice"><title>BlockDevice in easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../easy_fs/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">BlockDevice</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.read_block">read_block</a></li><li><a href="#tymethod.write_block">write_block</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In easy_fs</a></h2><div id="sidebar-vars" data-name="BlockDevice" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../easy_fs/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="index.html">easy_fs</a>::<wbr><a class="trait" href="#">BlockDevice</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/easy_fs/block_dev.rs.html#4-9">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait BlockDevice: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> {
|
||||
fn <a href="#tymethod.read_block" class="fnname">read_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>);
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.write_block" class="fnname">write_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>);
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait for block devices
|
||||
which reads and writes data in the unit of blocks</p>
|
||||
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.read_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/easy_fs/block_dev.rs.html#6">source</a></div><h4 class="code-header">fn <a href="#tymethod.read_block" class="fnname">read_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>)</h4></div></summary><div class="docblock"><p>Read data form block to buffer</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.write_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/easy_fs/block_dev.rs.html#8">source</a></div><h4 class="code-header">fn <a href="#tymethod.write_block" class="fnname">write_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>)</h4></div></summary><div class="docblock"><p>Write data from buffer to block</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../implementors/easy_fs/trait.BlockDevice.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="easy_fs" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/easy_fs/vfs/struct.Inode.html
Normal file
11
ch6/easy_fs/vfs/struct.Inode.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../easy_fs/struct.Inode.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../easy_fs/struct.Inode.html">../../easy_fs/struct.Inode.html</a>...</p>
|
||||
<script>location.replace("../../easy_fs/struct.Inode.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
12
ch6/embedded_hal/adc/index.html
Normal file
12
ch6/embedded_hal/adc/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!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="Analog-digital conversion traits"><meta name="keywords" content="rust, rustlang, rust-lang, adc"><title>embedded_hal::adc - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module adc</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="adc" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">embedded_hal</a>::<wbr><a class="mod" href="#">adc</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#1-90">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Analog-digital conversion traits</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Channel.html" title="embedded_hal::adc::Channel trait">Channel</a></div><div class="item-right docblock-short"><p>A marker trait to identify MCU pins that can be used as inputs to an ADC channel.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.OneShot.html" title="embedded_hal::adc::OneShot trait">OneShot</a></div><div class="item-right docblock-short"><p>ADCs that sample on single channels per request, and do so at the time of the request.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/adc/sidebar-items.js
Normal file
1
ch6/embedded_hal/adc/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Channel","A marker trait to identify MCU pins that can be used as inputs to an ADC channel."],["OneShot","ADCs that sample on single channels per request, and do so at the time of the request."]]});
|
45
ch6/embedded_hal/adc/trait.Channel.html
Normal file
45
ch6/embedded_hal/adc/trait.Channel.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!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 marker trait to identify MCU pins that can be used as inputs to an ADC channel."><meta name="keywords" content="rust, rustlang, rust-lang, Channel"><title>Channel in embedded_hal::adc - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Channel</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.ID">ID</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#associated-const">Associated Constants</a></h3><ul><li><a href="#associatedconstant.CHANNEL">CHANNEL</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::adc</a></h2><div id="sidebar-vars" data-name="Channel" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">embedded_hal</a>::<wbr><a href="index.html">adc</a>::<wbr><a class="trait" href="#">Channel</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#37-48">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Channel<ADC> {
|
||||
type <a href="#associatedtype.ID" class="associatedtype">ID</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>;
|
||||
|
||||
const <a href="#associatedconstant.CHANNEL" class="constant">CHANNEL</a>: Self::<a class="associatedtype" href="trait.Channel.html#associatedtype.ID" title="type embedded_hal::adc::Channel::ID">ID</a>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A marker trait to identify MCU pins that can be used as inputs to an ADC channel.</p>
|
||||
<p>This marker trait denotes an object, i.e. a GPIO pin, that is ready for use as an input to the
|
||||
ADC. As ADCs channels can be supplied by multiple pins, this trait defines the relationship
|
||||
between the physical interface and the ADC sampling buffer.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
||||
<span class="kw">struct</span> <span class="ident">Adc1</span>; <span class="comment">// Example ADC with single bank of 8 channels</span>
|
||||
<span class="kw">struct</span> <span class="ident">Gpio1Pin1</span><span class="op"><</span><span class="ident">MODE</span><span class="op">></span>(<span class="ident">PhantomData</span><span class="op"><</span><span class="ident">MODE</span><span class="op">></span>);
|
||||
<span class="kw">struct</span> <span class="ident">Analog</span>(()); <span class="comment">// marker type to denote a pin in "analog" mode</span>
|
||||
|
||||
<span class="comment">// GPIO 1 pin 1 can supply an ADC channel when it is configured in Analog mode</span>
|
||||
<span class="kw">impl</span> <span class="ident">Channel</span><span class="op"><</span><span class="ident">Adc1</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Gpio1Pin1</span><span class="op"><</span><span class="ident">Analog</span><span class="op">></span> {
|
||||
<span class="kw">type</span> <span class="ident">ID</span> <span class="op">=</span> <span class="ident">u8</span>; <span class="comment">// ADC channels are identified numerically</span>
|
||||
|
||||
<span class="kw">const</span> <span class="ident">CHANNEL</span>: <span class="ident">u8</span> <span class="op">=</span> <span class="number">7_u8</span>; <span class="comment">// GPIO pin 1 is connected to ADC channel 7</span>
|
||||
}
|
||||
|
||||
<span class="kw">struct</span> <span class="ident">Adc2</span>; <span class="comment">// ADC with two banks of 16 channels</span>
|
||||
<span class="kw">struct</span> <span class="ident">Gpio2PinA</span><span class="op"><</span><span class="ident">MODE</span><span class="op">></span>(<span class="ident">PhantomData</span><span class="op"><</span><span class="ident">MODE</span><span class="op">></span>);
|
||||
<span class="kw">struct</span> <span class="ident">AltFun</span>(()); <span class="comment">// marker type to denote some alternate function mode for the pin</span>
|
||||
|
||||
<span class="comment">// GPIO 2 pin A can supply an ADC channel when it's configured in some alternate function mode</span>
|
||||
<span class="kw">impl</span> <span class="ident">Channel</span><span class="op"><</span><span class="ident">Adc2</span><span class="op">></span> <span class="kw">for</span> <span class="ident">Gpio2PinA</span><span class="op"><</span><span class="ident">AltFun</span><span class="op">></span> {
|
||||
<span class="kw">type</span> <span class="ident">ID</span> <span class="op">=</span> (<span class="ident">u8</span>, <span class="ident">u8</span>); <span class="comment">// ADC channels are identified by bank number and channel number</span>
|
||||
|
||||
<span class="kw">const</span> <span class="ident">CHANNEL</span>: (<span class="ident">u8</span>, <span class="ident">u8</span>) <span class="op">=</span> (<span class="number">0</span>, <span class="number">3</span>); <span class="comment">// bank 0 channel 3</span>
|
||||
}</code></pre></div>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.ID" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#43">source</a></div><h4 class="code-header">type <a href="#associatedtype.ID" class="associatedtype">ID</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a></h4></div></summary><div class="docblock"><p>Channel ID type</p>
|
||||
<p>A type used to identify this ADC channel. For example, if the ADC has eight channels, this
|
||||
might be a <code>u8</code>. If the ADC has multiple banks of channels, it could be a tuple, like
|
||||
<code>(u8: bank_id, u8: channel_id)</code>.</p>
|
||||
</div></details></div><h2 id="associated-const" class="small-section-header">Associated Constants<a href="#associated-const" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedconstant.CHANNEL" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#47">source</a></div><h4 class="code-header">const <a href="#associatedconstant.CHANNEL" class="constant">CHANNEL</a>: Self::<a class="associatedtype" href="trait.Channel.html#associatedtype.ID" title="type embedded_hal::adc::Channel::ID">ID</a></h4></div></summary><div class="docblock"><p>Get the specific ID that identifies this channel, for example <code>0_u8</code> for the first ADC
|
||||
channel, if Self::ID is u8.</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/embedded_hal/adc/trait.Channel.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
38
ch6/embedded_hal/adc/trait.OneShot.html
Normal file
38
ch6/embedded_hal/adc/trait.OneShot.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!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="ADCs that sample on single channels per request, and do so at the time of the request."><meta name="keywords" content="rust, rustlang, rust-lang, OneShot"><title>OneShot in embedded_hal::adc - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">OneShot</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_read">try_read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::adc</a></h2><div id="sidebar-vars" data-name="OneShot" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">embedded_hal</a>::<wbr><a href="index.html">adc</a>::<wbr><a class="trait" href="#">OneShot</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#81-90">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait OneShot<ADC, Word, Pin: <a class="trait" href="trait.Channel.html" title="trait embedded_hal::adc::Channel">Channel</a><ADC>> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_read" class="fnname">try_read</a>(&mut self, pin: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>Pin) -> <a class="type" href="https://docs.rs/nb/1.0.0/nb/type.Result.html" title="type nb::Result">Result</a><Word, Self::<a class="associatedtype" href="trait.OneShot.html#associatedtype.Error" title="type embedded_hal::adc::OneShot::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>ADCs that sample on single channels per request, and do so at the time of the request.</p>
|
||||
<p>This trait is the interface to an ADC that is configured to read a specific channel at the time
|
||||
of the request (in contrast to continuous asynchronous sampling).</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">embedded_hal::adc</span>::{<span class="ident">Channel</span>, <span class="ident">OneShot</span>};
|
||||
|
||||
<span class="kw">struct</span> <span class="ident">MyAdc</span>; <span class="comment">// 10-bit ADC, with 5 channels</span>
|
||||
|
||||
<span class="kw">impl</span><span class="op"><</span><span class="ident">WORD</span>, <span class="ident">PIN</span><span class="op">></span> <span class="ident">OneShot</span><span class="op"><</span><span class="ident">MyAdc</span>, <span class="ident">WORD</span>, <span class="ident">PIN</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MyAdc</span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">WORD</span>: <span class="ident">From</span><span class="op"><</span><span class="ident">u16</span><span class="op">></span>,
|
||||
<span class="ident">PIN</span>: <span class="ident">Channel</span><span class="op"><</span><span class="ident">MyAdc</span>, <span class="ident">ID</span><span class="op">=</span><span class="ident">u8</span><span class="op">></span>,
|
||||
{
|
||||
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> ();
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">try_read</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">_pin</span>: <span class="kw-2">&mut</span> <span class="ident">PIN</span>) -> <span class="ident">nb::Result</span><span class="op"><</span><span class="ident">WORD</span>, <span class="ident"><span class="self">Self</span>::Error</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">chan</span> <span class="op">=</span> <span class="number">1</span> <span class="op"><</span><span class="op"><</span> <span class="ident">PIN::CHANNEL</span>;
|
||||
<span class="self">self</span>.<span class="ident">power_up</span>();
|
||||
<span class="kw">let</span> <span class="ident">result</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">do_conversion</span>(<span class="ident">chan</span>);
|
||||
<span class="self">self</span>.<span class="ident">power_down</span>();
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">result</span>.<span class="ident">into</span>())
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#83">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type returned by ADC methods</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_read" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/adc.rs.html#89">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_read" class="fnname">try_read</a>(&mut self, pin: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>Pin) -> <a class="type" href="https://docs.rs/nb/1.0.0/nb/type.Result.html" title="type nb::Result">Result</a><Word, Self::<a class="associatedtype" href="trait.OneShot.html#associatedtype.Error" title="type embedded_hal::adc::OneShot::Error">Error</a>></h4></div></summary><div class="docblock"><p>Request that the ADC begin a conversion on the specified pin</p>
|
||||
<p>This method takes a <code>Pin</code> reference, as it is expected that the ADC will be able to sample
|
||||
whatever channel underlies the pin.</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/embedded_hal/adc/trait.OneShot.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
7
ch6/embedded_hal/all.html
Normal file
7
ch6/embedded_hal/all.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!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="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location">Crate embedded_hal</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../embedded_hal/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="spi/struct.Mode.html">spi::Mode</a></li></ul><h3 id="Enums">Enums</h3><ul class="enums docblock"><li><a href="qei/enum.Direction.html">qei::Direction</a></li><li><a href="spi/enum.Phase.html">spi::Phase</a></li><li><a href="spi/enum.Polarity.html">spi::Polarity</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="adc/trait.Channel.html">adc::Channel</a></li><li><a href="adc/trait.OneShot.html">adc::OneShot</a></li><li><a href="blocking/delay/trait.DelayMs.html">blocking::delay::DelayMs</a></li><li><a href="blocking/delay/trait.DelayUs.html">blocking::delay::DelayUs</a></li><li><a href="blocking/i2c/trait.Read.html">blocking::i2c::Read</a></li><li><a href="blocking/i2c/trait.Write.html">blocking::i2c::Write</a></li><li><a href="blocking/i2c/trait.WriteIter.html">blocking::i2c::WriteIter</a></li><li><a href="blocking/i2c/trait.WriteIterRead.html">blocking::i2c::WriteIterRead</a></li><li><a href="blocking/i2c/trait.WriteRead.html">blocking::i2c::WriteRead</a></li><li><a href="blocking/rng/trait.Read.html">blocking::rng::Read</a></li><li><a href="blocking/serial/trait.Write.html">blocking::serial::Write</a></li><li><a href="blocking/serial/write/trait.Default.html">blocking::serial::write::Default</a></li><li><a href="blocking/spi/trait.Transfer.html">blocking::spi::Transfer</a></li><li><a href="blocking/spi/trait.Write.html">blocking::spi::Write</a></li><li><a href="blocking/spi/trait.WriteIter.html">blocking::spi::WriteIter</a></li><li><a href="blocking/spi/transfer/trait.Default.html">blocking::spi::transfer::Default</a></li><li><a href="blocking/spi/write/trait.Default.html">blocking::spi::write::Default</a></li><li><a href="blocking/spi/write_iter/trait.Default.html">blocking::spi::write_iter::Default</a></li><li><a href="capture/trait.Capture.html">capture::Capture</a></li><li><a href="digital/trait.InputPin.html">digital::InputPin</a></li><li><a href="digital/trait.OutputPin.html">digital::OutputPin</a></li><li><a href="digital/trait.StatefulOutputPin.html">digital::StatefulOutputPin</a></li><li><a href="digital/trait.ToggleableOutputPin.html">digital::ToggleableOutputPin</a></li><li><a href="digital/toggleable/trait.Default.html">digital::toggleable::Default</a></li><li><a href="pwm/trait.Pwm.html">pwm::Pwm</a></li><li><a href="pwm/trait.PwmPin.html">pwm::PwmPin</a></li><li><a href="qei/trait.Qei.html">qei::Qei</a></li><li><a href="rng/trait.Read.html">rng::Read</a></li><li><a href="serial/trait.Read.html">serial::Read</a></li><li><a href="serial/trait.Write.html">serial::Write</a></li><li><a href="spi/trait.FullDuplex.html">spi::FullDuplex</a></li><li><a href="timer/trait.Cancel.html">timer::Cancel</a></li><li><a href="timer/trait.CountDown.html">timer::CountDown</a></li><li><a href="timer/trait.Periodic.html">timer::Periodic</a></li><li><a href="watchdog/trait.Watchdog.html">watchdog::Watchdog</a></li><li><a href="watchdog/trait.WatchdogDisable.html">watchdog::WatchdogDisable</a></li><li><a href="watchdog/trait.WatchdogEnable.html">watchdog::WatchdogEnable</a></li></ul><h3 id="Constants">Constants</h3><ul class="constants docblock"><li><a href="spi/constant.MODE_0.html">spi::MODE_0</a></li><li><a href="spi/constant.MODE_1.html">spi::MODE_1</a></li><li><a href="spi/constant.MODE_2.html">spi::MODE_2</a></li><li><a href="spi/constant.MODE_3.html">spi::MODE_3</a></li></ul></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
17
ch6/embedded_hal/blocking/delay/index.html
Normal file
17
ch6/embedded_hal/blocking/delay/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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="Delays"><meta name="keywords" content="rust, rustlang, rust-lang, delay"><title>embedded_hal::blocking::delay - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module delay</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="delay" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a class="mod" href="#">delay</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#1-32">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Delays</p>
|
||||
<h2 id="whats-the-difference-between-these-traits-and-the-timercountdown-trait"><a href="#whats-the-difference-between-these-traits-and-the-timercountdown-trait">What’s the difference between these traits and the <code>timer::CountDown</code> trait?</a></h2>
|
||||
<p>The <code>Timer</code> trait provides a <em>non-blocking</em> timer abstraction and it’s meant to be used to build
|
||||
higher level abstractions like I/O operations with timeouts. OTOH, these delays traits only
|
||||
provide <em>blocking</em> functionality. Note that you can also use the <code>timer::CountDown</code> trait to
|
||||
implement blocking delays.</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.DelayMs.html" title="embedded_hal::blocking::delay::DelayMs trait">DelayMs</a></div><div class="item-right docblock-short"><p>Millisecond delay</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.DelayUs.html" title="embedded_hal::blocking::delay::DelayUs trait">DelayUs</a></div><div class="item-right docblock-short"><p>Microsecond delay</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/delay/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/delay/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["DelayMs","Millisecond delay"],["DelayUs","Microsecond delay"]]});
|
16
ch6/embedded_hal/blocking/delay/trait.DelayMs.html
Normal file
16
ch6/embedded_hal/blocking/delay/trait.DelayMs.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!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="Millisecond delay"><meta name="keywords" content="rust, rustlang, rust-lang, DelayMs"><title>DelayMs in embedded_hal::blocking::delay - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">DelayMs</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_delay_ms">try_delay_ms</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::delay</a></h2><div id="sidebar-vars" data-name="DelayMs" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">delay</a>::<wbr><a class="trait" href="#">DelayMs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#14-20">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait DelayMs<UXX> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_delay_ms" class="fnname">try_delay_ms</a>(&mut self, ms: UXX) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.DelayMs.html#associatedtype.Error" title="type embedded_hal::blocking::delay::DelayMs::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Millisecond delay</p>
|
||||
<p><code>UXX</code> denotes the range type of the delay time. <code>UXX</code> can be <code>u8</code>, <code>u16</code>, etc. A single type can
|
||||
implement this trait for different types of <code>UXX</code>.</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#16">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Enumeration of <code>DelayMs</code> errors</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_delay_ms" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#19">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_delay_ms" class="fnname">try_delay_ms</a>(&mut self, ms: UXX) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.DelayMs.html#associatedtype.Error" title="type embedded_hal::blocking::delay::DelayMs::Error">Error</a>></h4></div></summary><div class="docblock"><p>Pauses execution for <code>ms</code> milliseconds</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/delay/trait.DelayMs.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
16
ch6/embedded_hal/blocking/delay/trait.DelayUs.html
Normal file
16
ch6/embedded_hal/blocking/delay/trait.DelayUs.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!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="Microsecond delay"><meta name="keywords" content="rust, rustlang, rust-lang, DelayUs"><title>DelayUs in embedded_hal::blocking::delay - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">DelayUs</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_delay_us">try_delay_us</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::delay</a></h2><div id="sidebar-vars" data-name="DelayUs" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">delay</a>::<wbr><a class="trait" href="#">DelayUs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#26-32">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait DelayUs<UXX> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_delay_us" class="fnname">try_delay_us</a>(&mut self, us: UXX) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.DelayUs.html#associatedtype.Error" title="type embedded_hal::blocking::delay::DelayUs::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Microsecond delay</p>
|
||||
<p><code>UXX</code> denotes the range type of the delay time. <code>UXX</code> can be <code>u8</code>, <code>u16</code>, etc. A single type can
|
||||
implement this trait for different types of <code>UXX</code>.</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#28">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Enumeration of <code>DelayMs</code> errors</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_delay_us" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/delay.rs.html#31">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_delay_us" class="fnname">try_delay_us</a>(&mut self, us: UXX) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.DelayUs.html#associatedtype.Error" title="type embedded_hal::blocking::delay::DelayUs::Error">Error</a>></h4></div></summary><div class="docblock"><p>Pauses execution for <code>us</code> microseconds</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/delay/trait.DelayUs.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
18
ch6/embedded_hal/blocking/i2c/index.html
Normal file
18
ch6/embedded_hal/blocking/i2c/index.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!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="Blocking I2C API"><meta name="keywords" content="rust, rustlang, rust-lang, i2c"><title>embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module i2c</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="i2c" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a class="mod" href="#">i2c</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#1-127">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking I2C API</p>
|
||||
<p>Slave addresses used by this API are 7-bit I2C addresses ranging from 0 to 127.</p>
|
||||
<p>Operations on 10-bit slave addresses are not supported by the API yet (but applications might
|
||||
be able to emulate some operations).</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Read.html" title="embedded_hal::blocking::i2c::Read trait">Read</a></div><div class="item-right docblock-short"><p>Blocking read</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Write.html" title="embedded_hal::blocking::i2c::Write trait">Write</a></div><div class="item-right docblock-short"><p>Blocking write</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.WriteIter.html" title="embedded_hal::blocking::i2c::WriteIter trait">WriteIter</a></div><div class="item-right docblock-short"><p>Blocking write (iterator version)</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.WriteIterRead.html" title="embedded_hal::blocking::i2c::WriteIterRead trait">WriteIterRead</a></div><div class="item-right docblock-short"><p>Blocking write (iterator version) + read</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.WriteRead.html" title="embedded_hal::blocking::i2c::WriteRead trait">WriteRead</a></div><div class="item-right docblock-short"><p>Blocking write + read</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/i2c/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/i2c/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Read","Blocking read"],["Write","Blocking write"],["WriteIter","Blocking write (iterator version)"],["WriteIterRead","Blocking write (iterator version) + read"],["WriteRead","Blocking write + read"]]});
|
26
ch6/embedded_hal/blocking/i2c/trait.Read.html
Normal file
26
ch6/embedded_hal/blocking/i2c/trait.Read.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!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="Blocking read"><meta name="keywords" content="rust, rustlang, rust-lang, Read"><title>Read in embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Read</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_read">try_read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::i2c</a></h2><div id="sidebar-vars" data-name="Read" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">i2c</a>::<wbr><a class="trait" href="#">Read</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#9-32">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Read {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_read" class="fnname">try_read</a>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br> ) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Read.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::Read::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking read</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#11">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_read" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#31">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_read" class="fnname">try_read</a>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Read.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::Read::Error">Error</a>></h4></div></summary><div class="docblock"><p>Reads enough bytes from slave with <code>address</code> to fill <code>buffer</code></p>
|
||||
<h5 id="i2c-events-contract"><a href="#i2c-events-contract">I2C Events (contract)</a></h5><div class="example-wrap"><pre class="language-text"><code>Master: ST SAD+R MAK MAK ... NMAK SP
|
||||
Slave: SAK B0 B1 ... BN</code></pre></div>
|
||||
<p>Where</p>
|
||||
<ul>
|
||||
<li><code>ST</code> = start condition</li>
|
||||
<li><code>SAD+R</code> = slave address followed by bit 1 to indicate reading</li>
|
||||
<li><code>SAK</code> = slave acknowledge</li>
|
||||
<li><code>Bi</code> = ith byte of data</li>
|
||||
<li><code>MAK</code> = master acknowledge</li>
|
||||
<li><code>NMAK</code> = master no acknowledge</li>
|
||||
<li><code>SP</code> = stop condition</li>
|
||||
</ul>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/i2c/trait.Read.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
24
ch6/embedded_hal/blocking/i2c/trait.Write.html
Normal file
24
ch6/embedded_hal/blocking/i2c/trait.Write.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!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="Blocking write"><meta name="keywords" content="rust, rustlang, rust-lang, Write"><title>Write in embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Write</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write">try_write</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::i2c</a></h2><div id="sidebar-vars" data-name="Write" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">i2c</a>::<wbr><a class="trait" href="#">Write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#35-56">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Write {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write" class="fnname">try_write</a>(&mut self, addr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::Write::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#37">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#55">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write" class="fnname">try_write</a>(&mut self, addr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::Write::Error">Error</a>></h4></div></summary><div class="docblock"><p>Sends bytes to slave with address <code>addr</code></p>
|
||||
<h5 id="i2c-events-contract"><a href="#i2c-events-contract">I2C Events (contract)</a></h5><div class="example-wrap"><pre class="language-text"><code>Master: ST SAD+W B0 B1 ... BN SP
|
||||
Slave: SAK SAK SAK ... SAK</code></pre></div>
|
||||
<p>Where</p>
|
||||
<ul>
|
||||
<li><code>ST</code> = start condition</li>
|
||||
<li><code>SAD+W</code> = slave address followed by bit 0 to indicate writing</li>
|
||||
<li><code>SAK</code> = slave acknowledge</li>
|
||||
<li><code>Bi</code> = ith byte of data</li>
|
||||
<li><code>SP</code> = stop condition</li>
|
||||
</ul>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/i2c/trait.Write.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
16
ch6/embedded_hal/blocking/i2c/trait.WriteIter.html
Normal file
16
ch6/embedded_hal/blocking/i2c/trait.WriteIter.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!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="Blocking write (iterator version)"><meta name="keywords" content="rust, rustlang, rust-lang, WriteIter"><title>WriteIter in embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">WriteIter</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write">try_write</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::i2c</a></h2><div id="sidebar-vars" data-name="WriteIter" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">i2c</a>::<wbr><a class="trait" href="#">WriteIter</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#59-71">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait WriteIter {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write" class="fnname">try_write</a><B>(&mut self, addr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, bytes: B) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIter.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteIter::Error">Error</a>><br> <span class="where">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>></span>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write (iterator version)</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#61">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#68-70">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write" class="fnname">try_write</a><B>(&mut self, addr: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, bytes: B) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIter.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteIter::Error">Error</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>>, </span></h4></div></summary><div class="docblock"><p>Sends bytes to slave with address <code>addr</code></p>
|
||||
<h5 id="i2c-events-contract"><a href="#i2c-events-contract">I2C Events (contract)</a></h5>
|
||||
<p>Same as <code>Write</code></p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/i2c/trait.WriteIter.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
17
ch6/embedded_hal/blocking/i2c/trait.WriteIterRead.html
Normal file
17
ch6/embedded_hal/blocking/i2c/trait.WriteIterRead.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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="Blocking write (iterator version) + read"><meta name="keywords" content="rust, rustlang, rust-lang, WriteIterRead"><title>WriteIterRead in embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">WriteIterRead</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write_iter_read">try_write_iter_read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::i2c</a></h2><div id="sidebar-vars" data-name="WriteIterRead" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">i2c</a>::<wbr><a class="trait" href="#">WriteIterRead</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#109-127">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait WriteIterRead {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write_iter_read" class="fnname">try_write_iter_read</a><B>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> bytes: B, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br> ) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIterRead.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteIterRead::Error">Error</a>><br> <span class="where">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>></span>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write (iterator version) + read</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#111">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write_iter_read" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#119-126">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write_iter_read" class="fnname">try_write_iter_read</a><B>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> bytes: B, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIterRead.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteIterRead::Error">Error</a>> <span class="where fmt-newline">where<br> B: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>>, </span></h4></div></summary><div class="docblock"><p>Sends bytes to slave with address <code>addr</code> and then reads enough bytes to fill <code>buffer</code> <em>in a
|
||||
single transaction</em></p>
|
||||
<h5 id="i2c-events-contract"><a href="#i2c-events-contract">I2C Events (contract)</a></h5>
|
||||
<p>Same as the <code>WriteRead</code> trait</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/i2c/trait.WriteIterRead.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
30
ch6/embedded_hal/blocking/i2c/trait.WriteRead.html
Normal file
30
ch6/embedded_hal/blocking/i2c/trait.WriteRead.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!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="Blocking write + read"><meta name="keywords" content="rust, rustlang, rust-lang, WriteRead"><title>WriteRead in embedded_hal::blocking::i2c - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">WriteRead</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write_read">try_write_read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::i2c</a></h2><div id="sidebar-vars" data-name="WriteRead" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">i2c</a>::<wbr><a class="trait" href="#">WriteRead</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#74-106">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait WriteRead {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write_read" class="fnname">try_write_read</a>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br> ) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteRead.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteRead::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write + read</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#76">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write_read" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/i2c.rs.html#100-105">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write_read" class="fnname">try_write_read</a>(<br> &mut self, <br> address: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a>, <br> bytes: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>, <br> buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a><br>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteRead.html#associatedtype.Error" title="type embedded_hal::blocking::i2c::WriteRead::Error">Error</a>></h4></div></summary><div class="docblock"><p>Sends bytes to slave with address <code>addr</code> and then reads enough bytes to fill <code>buffer</code> <em>in a
|
||||
single transaction</em></p>
|
||||
<h5 id="i2c-events-contract"><a href="#i2c-events-contract">I2C Events (contract)</a></h5><div class="example-wrap"><pre class="language-text"><code>Master: ST SAD+W O0 O1 ... OM SR SAD+R MAK MAK ... NMAK SP
|
||||
Slave: SAK SAK SAK ... SAK SAK I0 I1 ... IN</code></pre></div>
|
||||
<p>Where</p>
|
||||
<ul>
|
||||
<li><code>ST</code> = start condition</li>
|
||||
<li><code>SAD+W</code> = slave address followed by bit 0 to indicate writing</li>
|
||||
<li><code>SAK</code> = slave acknowledge</li>
|
||||
<li><code>Oi</code> = ith outgoing byte of data</li>
|
||||
<li><code>SR</code> = repeated start condition</li>
|
||||
<li><code>SAD+R</code> = slave address followed by bit 1 to indicate reading</li>
|
||||
<li><code>Ii</code> = ith incoming byte of data</li>
|
||||
<li><code>MAK</code> = master acknowledge</li>
|
||||
<li><code>NMAK</code> = master no acknowledge</li>
|
||||
<li><code>SP</code> = stop condition</li>
|
||||
</ul>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/i2c/trait.WriteRead.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
18
ch6/embedded_hal/blocking/index.html
Normal file
18
ch6/embedded_hal/blocking/index.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!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="Blocking API"><meta name="keywords" content="rust, rustlang, rust-lang, blocking"><title>embedded_hal::blocking - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module blocking</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li></ul></div></section><div id="sidebar-vars" data-name="blocking" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">embedded_hal</a>::<wbr><a class="mod" href="#">blocking</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/blocking/mod.rs.html#1-11">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking API</p>
|
||||
<p>In some cases it’s possible to implement these blocking traits on top of one of the core HAL
|
||||
traits. To save boilerplate when that’s the case a <code>Default</code> marker trait may be provided.
|
||||
Implementing that marker trait will opt in your type into a blanket implementation.</p>
|
||||
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="delay/index.html" title="embedded_hal::blocking::delay mod">delay</a></div><div class="item-right docblock-short"><p>Delays</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="i2c/index.html" title="embedded_hal::blocking::i2c mod">i2c</a></div><div class="item-right docblock-short"><p>Blocking I2C API</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="rng/index.html" title="embedded_hal::blocking::rng mod">rng</a></div><div class="item-right docblock-short"><p>Blocking hardware random number generator</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="serial/index.html" title="embedded_hal::blocking::serial mod">serial</a></div><div class="item-right docblock-short"><p>Blocking serial API</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="spi/index.html" title="embedded_hal::blocking::spi mod">spi</a></div><div class="item-right docblock-short"><p>Blocking SPI API</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/embedded_hal/blocking/rng/index.html
Normal file
11
ch6/embedded_hal/blocking/rng/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!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="Blocking hardware random number generator"><meta name="keywords" content="rust, rustlang, rust-lang, rng"><title>embedded_hal::blocking::rng - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module rng</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="rng" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a class="mod" href="#">rng</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/rng.rs.html#1-16">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking hardware random number generator</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Read.html" title="embedded_hal::blocking::rng::Read trait">Read</a></div><div class="item-right docblock-short"><p>Blocking read</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/rng/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/rng/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Read","Blocking read"]]});
|
18
ch6/embedded_hal/blocking/rng/trait.Read.html
Normal file
18
ch6/embedded_hal/blocking/rng/trait.Read.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!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="Blocking read"><meta name="keywords" content="rust, rustlang, rust-lang, Read"><title>Read in embedded_hal::blocking::rng - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Read</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_read">try_read</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::rng</a></h2><div id="sidebar-vars" data-name="Read" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">rng</a>::<wbr><a class="trait" href="#">Read</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/rng.rs.html#4-16">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Read {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_read" class="fnname">try_read</a>(&mut self, buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Read.html#associatedtype.Error" title="type embedded_hal::blocking::rng::Read::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking read</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/rng.rs.html#6">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_read" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/rng.rs.html#15">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_read" class="fnname">try_read</a>(&mut self, buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Read.html#associatedtype.Error" title="type embedded_hal::blocking::rng::Read::Error">Error</a>></h4></div></summary><div class="docblock"><p>Reads enough bytes from hardware random number generator to fill <code>buffer</code></p>
|
||||
<p>If any error is encountered then this function immediately returns. The contents of buf are
|
||||
unspecified in this case.</p>
|
||||
<p>If this function returns an error, it is unspecified how many bytes it has read, but it
|
||||
will never read more than would be necessary to completely fill the buffer.</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/rng/trait.Read.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
13
ch6/embedded_hal/blocking/serial/index.html
Normal file
13
ch6/embedded_hal/blocking/serial/index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!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="Blocking serial API"><meta name="keywords" content="rust, rustlang, rust-lang, serial"><title>embedded_hal::blocking::serial - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module serial</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="serial" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a class="mod" href="#">serial</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#1-54">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking serial API</p>
|
||||
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="write/index.html" title="embedded_hal::blocking::serial::write mod">write</a></div><div class="item-right docblock-short"><p>Blocking serial write</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Write.html" title="embedded_hal::blocking::serial::Write trait">Write</a></div><div class="item-right docblock-short"><p>Write half of a serial interface (blocking variant)</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/serial/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/serial/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"mod":[["write","Blocking serial write"]],"trait":[["Write","Write half of a serial interface (blocking variant)"]]});
|
20
ch6/embedded_hal/blocking/serial/trait.Write.html
Normal file
20
ch6/embedded_hal/blocking/serial/trait.Write.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!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="Write half of a serial interface (blocking variant)"><meta name="keywords" content="rust, rustlang, rust-lang, Write"><title>Write in embedded_hal::blocking::serial - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Write</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_bflush">try_bflush</a></li><li><a href="#tymethod.try_bwrite_all">try_bwrite_all</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::serial</a></h2><div id="sidebar-vars" data-name="Write" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">serial</a>::<wbr><a class="trait" href="#">Write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#4-20">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Write<Word> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_bwrite_all" class="fnname">try_bwrite_all</a>(&mut self, buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[Word]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::serial::Write::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_bflush" class="fnname">try_bflush</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::serial::Write::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Write half of a serial interface (blocking variant)</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#6">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>The type of error that can occur when writing</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_bwrite_all" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#16">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_bwrite_all" class="fnname">try_bwrite_all</a>(&mut self, buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[Word]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::serial::Write::Error">Error</a>></h4></div></summary><div class="docblock"><p>Writes a slice, blocking until everything has been written</p>
|
||||
<p>An implementation can choose to buffer the write, returning <code>Ok(())</code>
|
||||
after the complete slice has been written to a buffer, but before all
|
||||
words have been sent via the serial interface. To make sure that
|
||||
everything has been sent, call <a href="#tymethod.bflush"><code>try_bflush</code></a> after this function returns.</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_bflush" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#19">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_bflush" class="fnname">try_bflush</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::serial::Write::Error">Error</a>></h4></div></summary><div class="docblock"><p>Block until the serial interface has sent all buffered words</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Write%3CWord%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/serial.rs.html#34-53">source</a></span><a href="#impl-Write%3CWord%3E" class="anchor"></a><h3 class="code-header in-band">impl<S, Word> <a class="trait" href="trait.Write.html" title="trait embedded_hal::blocking::serial::Write">Write</a><Word> for S <span class="where fmt-newline">where<br> S: <a class="trait" href="write/trait.Default.html" title="trait embedded_hal::blocking::serial::write::Default">Default</a><Word>,<br> Word: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = S::<a class="associatedtype" href="../../serial/trait.Write.html#associatedtype.Error" title="type embedded_hal::serial::Write::Error">Error</a></h4></section></div></details></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/serial/trait.Write.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/embedded_hal/blocking/serial/write/index.html
Normal file
11
ch6/embedded_hal/blocking/serial/write/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!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="Blocking serial write"><meta name="keywords" content="rust, rustlang, rust-lang, write"><title>embedded_hal::blocking::serial::write - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module write</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="write" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">serial</a>::<wbr><a class="mod" href="#">write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/serial.rs.html#23-54">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking serial write</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Default.html" title="embedded_hal::blocking::serial::write::Default trait">Default</a></div><div class="item-right docblock-short"><p>Marker trait to opt into default blocking write implementation</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/serial/write/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/serial/write/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Default","Marker trait to opt into default blocking write implementation"]]});
|
12
ch6/embedded_hal/blocking/serial/write/trait.Default.html
Normal file
12
ch6/embedded_hal/blocking/serial/write/trait.Default.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!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="Marker trait to opt into default blocking write implementation"><meta name="keywords" content="rust, rustlang, rust-lang, Default"><title>Default in embedded_hal::blocking::serial::write - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Default</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::serial::write</a></h2><div id="sidebar-vars" data-name="Default" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">serial</a>::<wbr><a href="index.html">write</a>::<wbr><a class="trait" href="#">Default</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/serial.rs.html#32">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Default<Word>: <a class="trait" href="../../../serial/trait.Write.html" title="trait embedded_hal::serial::Write">Write</a><Word> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Marker trait to opt into default blocking write implementation</p>
|
||||
<p>Implementers of <a href="../../serial/trait.Write.html"><code>serial::Write</code></a> can implement this marker trait
|
||||
for their type. Doing so will automatically provide the default
|
||||
implementation of <a href="../trait.Write.html"><code>blocking::serial::Write</code></a> for the type.</p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../../implementors/embedded_hal/blocking/serial/write/trait.Default.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"mod":[["delay","Delays"],["i2c","Blocking I2C API"],["rng","Blocking hardware random number generator"],["serial","Blocking serial API"],["spi","Blocking SPI API"]]});
|
17
ch6/embedded_hal/blocking/spi/index.html
Normal file
17
ch6/embedded_hal/blocking/spi/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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="Blocking SPI API"><meta name="keywords" content="rust, rustlang, rust-lang, spi"><title>embedded_hal::blocking::spi - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module spi</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="spi" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a class="mod" href="#">spi</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#1-104">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking SPI API</p>
|
||||
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="transfer/index.html" title="embedded_hal::blocking::spi::transfer mod">transfer</a></div><div class="item-right docblock-short"><p>Blocking transfer</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="write/index.html" title="embedded_hal::blocking::spi::write mod">write</a></div><div class="item-right docblock-short"><p>Blocking write</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="write_iter/index.html" title="embedded_hal::blocking::spi::write_iter mod">write_iter</a></div><div class="item-right docblock-short"><p>Blocking write (iterator version)</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Transfer.html" title="embedded_hal::blocking::spi::Transfer trait">Transfer</a></div><div class="item-right docblock-short"><p>Blocking transfer</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Write.html" title="embedded_hal::blocking::spi::Write trait">Write</a></div><div class="item-right docblock-short"><p>Blocking write</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.WriteIter.html" title="embedded_hal::blocking::spi::WriteIter trait">WriteIter</a></div><div class="item-right docblock-short"><p>Blocking write (iterator version)</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/spi/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/spi/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"mod":[["transfer","Blocking transfer"],["write","Blocking write"],["write_iter","Blocking write (iterator version)"]],"trait":[["Transfer","Blocking transfer"],["Write","Blocking write"],["WriteIter","Blocking write (iterator version)"]]});
|
14
ch6/embedded_hal/blocking/spi/trait.Transfer.html
Normal file
14
ch6/embedded_hal/blocking/spi/trait.Transfer.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!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="Blocking transfer"><meta name="keywords" content="rust, rustlang, rust-lang, Transfer"><title>Transfer in embedded_hal::blocking::spi - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Transfer</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_transfer">try_transfer</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi</a></h2><div id="sidebar-vars" data-name="Transfer" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">spi</a>::<wbr><a class="trait" href="#">Transfer</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#4-10">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Transfer<W> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_transfer" class="fnname">try_transfer</a><'w>(<br> &mut self, <br> words: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&'w mut [W]</a><br> ) -> <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/core/primitive.slice.html">&'w [W]</a>, Self::<a class="associatedtype" href="trait.Transfer.html#associatedtype.Error" title="type embedded_hal::blocking::spi::Transfer::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking transfer</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#6">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_transfer" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#9">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_transfer" class="fnname">try_transfer</a><'w>(<br> &mut self, <br> words: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&'w mut [W]</a><br>) -> <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/core/primitive.slice.html">&'w [W]</a>, Self::<a class="associatedtype" href="trait.Transfer.html#associatedtype.Error" title="type embedded_hal::blocking::spi::Transfer::Error">Error</a>></h4></div></summary><div class="docblock"><p>Sends <code>words</code> to the slave. Returns the <code>words</code> received from the slave</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Transfer%3CW%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#38-53">source</a></span><a href="#impl-Transfer%3CW%3E" class="anchor"></a><h3 class="code-header in-band">impl<W, S> <a class="trait" href="trait.Transfer.html" title="trait embedded_hal::blocking::spi::Transfer">Transfer</a><W> for S <span class="where fmt-newline">where<br> S: <a class="trait" href="transfer/trait.Default.html" title="trait embedded_hal::blocking::spi::transfer::Default">Default</a><W>,<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = S::<a class="associatedtype" href="../../spi/trait.FullDuplex.html#associatedtype.Error" title="type embedded_hal::spi::FullDuplex::Error">Error</a></h4></section></div></details></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/spi/trait.Transfer.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
14
ch6/embedded_hal/blocking/spi/trait.Write.html
Normal file
14
ch6/embedded_hal/blocking/spi/trait.Write.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!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="Blocking write"><meta name="keywords" content="rust, rustlang, rust-lang, Write"><title>Write in embedded_hal::blocking::spi - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Write</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write">try_write</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi</a></h2><div id="sidebar-vars" data-name="Write" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">spi</a>::<wbr><a class="trait" href="#">Write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#13-19">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Write<W> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write" class="fnname">try_write</a>(&mut self, words: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[W]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::spi::Write::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#15">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#18">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write" class="fnname">try_write</a>(&mut self, words: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[W]</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Write.html#associatedtype.Error" title="type embedded_hal::blocking::spi::Write::Error">Error</a>></h4></div></summary><div class="docblock"><p>Sends <code>words</code> to the slave, ignoring all the incoming words</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Write%3CW%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#61-76">source</a></span><a href="#impl-Write%3CW%3E" class="anchor"></a><h3 class="code-header in-band">impl<W, S> <a class="trait" href="trait.Write.html" title="trait embedded_hal::blocking::spi::Write">Write</a><W> for S <span class="where fmt-newline">where<br> S: <a class="trait" href="write/trait.Default.html" title="trait embedded_hal::blocking::spi::write::Default">Default</a><W>,<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = S::<a class="associatedtype" href="../../spi/trait.FullDuplex.html#associatedtype.Error" title="type embedded_hal::spi::FullDuplex::Error">Error</a></h4></section></div></details></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/spi/trait.Write.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
14
ch6/embedded_hal/blocking/spi/trait.WriteIter.html
Normal file
14
ch6/embedded_hal/blocking/spi/trait.WriteIter.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!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="Blocking write (iterator version)"><meta name="keywords" content="rust, rustlang, rust-lang, WriteIter"><title>WriteIter in embedded_hal::blocking::spi - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">WriteIter</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_write_iter">try_write_iter</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi</a></h2><div id="sidebar-vars" data-name="WriteIter" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">blocking</a>::<wbr><a href="index.html">spi</a>::<wbr><a class="trait" href="#">WriteIter</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#22-30">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait WriteIter<W> {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_write_iter" class="fnname">try_write_iter</a><WI>(&mut self, words: WI) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIter.html#associatedtype.Error" title="type embedded_hal::blocking::spi::WriteIter::Error">Error</a>><br> <span class="where">where<br> WI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = W></span>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write (iterator version)</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#24">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_write_iter" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#27-29">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_write_iter" class="fnname">try_write_iter</a><WI>(&mut self, words: WI) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.WriteIter.html#associatedtype.Error" title="type embedded_hal::blocking::spi::WriteIter::Error">Error</a>> <span class="where fmt-newline">where<br> WI: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = W>, </span></h4></div></summary><div class="docblock"><p>Sends <code>words</code> to the slave, ignoring all the incoming words</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-WriteIter%3CW%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../../src/embedded_hal/blocking/spi.rs.html#85-103">source</a></span><a href="#impl-WriteIter%3CW%3E" class="anchor"></a><h3 class="code-header in-band">impl<W, S> <a class="trait" href="trait.WriteIter.html" title="trait embedded_hal::blocking::spi::WriteIter">WriteIter</a><W> for S <span class="where fmt-newline">where<br> S: <a class="trait" href="write_iter/trait.Default.html" title="trait embedded_hal::blocking::spi::write_iter::Default">Default</a><W>,<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></h3></section></summary><div class="impl-items"><section id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a> = S::<a class="associatedtype" href="../../spi/trait.FullDuplex.html#associatedtype.Error" title="type embedded_hal::spi::FullDuplex::Error">Error</a></h4></section></div></details></div><script type="text/javascript" src="../../../implementors/embedded_hal/blocking/spi/trait.WriteIter.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
12
ch6/embedded_hal/blocking/spi/transfer/index.html
Normal file
12
ch6/embedded_hal/blocking/spi/transfer/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!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="Blocking transfer"><meta name="keywords" content="rust, rustlang, rust-lang, transfer"><title>embedded_hal::blocking::spi::transfer - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module transfer</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="transfer" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a class="mod" href="#">transfer</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#33-54">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking transfer</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Default.html" title="embedded_hal::blocking::spi::transfer::Default trait">Default</a></div><div class="item-right docblock-short"><p>Default implementation of <code>blocking::spi::Transfer<W></code> for implementers of
|
||||
<code>spi::FullDuplex<W></code></p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/spi/transfer/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/spi/transfer/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Default","Default implementation of `blocking::spi::Transfer<W>` for implementers of `spi::FullDuplex<W>`"]]});
|
10
ch6/embedded_hal/blocking/spi/transfer/trait.Default.html
Normal file
10
ch6/embedded_hal/blocking/spi/transfer/trait.Default.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!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="Default implementation of `blocking::spi::Transfer<W>` for implementers of `spi::FullDuplex<W>`"><meta name="keywords" content="rust, rustlang, rust-lang, Default"><title>Default in embedded_hal::blocking::spi::transfer - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Default</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi::transfer</a></h2><div id="sidebar-vars" data-name="Default" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a href="index.html">transfer</a>::<wbr><a class="trait" href="#">Default</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#36">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Default<W>: <a class="trait" href="../../../spi/trait.FullDuplex.html" title="trait embedded_hal::spi::FullDuplex">FullDuplex</a><W> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Default implementation of <code>blocking::spi::Transfer<W></code> for implementers of
|
||||
<code>spi::FullDuplex<W></code></p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../../implementors/embedded_hal/blocking/spi/transfer/trait.Default.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/embedded_hal/blocking/spi/write/index.html
Normal file
11
ch6/embedded_hal/blocking/spi/write/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!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="Blocking write"><meta name="keywords" content="rust, rustlang, rust-lang, write"><title>embedded_hal::blocking::spi::write - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module write</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="write" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a class="mod" href="#">write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#57-77">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Default.html" title="embedded_hal::blocking::spi::write::Default trait">Default</a></div><div class="item-right docblock-short"><p>Default implementation of <code>blocking::spi::Write<W></code> for implementers of <code>spi::FullDuplex<W></code></p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/blocking/spi/write/sidebar-items.js
Normal file
1
ch6/embedded_hal/blocking/spi/write/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Default","Default implementation of `blocking::spi::Write<W>` for implementers of `spi::FullDuplex<W>`"]]});
|
9
ch6/embedded_hal/blocking/spi/write/trait.Default.html
Normal file
9
ch6/embedded_hal/blocking/spi/write/trait.Default.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!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="Default implementation of `blocking::spi::Write<W>` for implementers of `spi::FullDuplex<W>`"><meta name="keywords" content="rust, rustlang, rust-lang, Default"><title>Default in embedded_hal::blocking::spi::write - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Default</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi::write</a></h2><div id="sidebar-vars" data-name="Default" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a href="index.html">write</a>::<wbr><a class="trait" href="#">Default</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#59">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Default<W>: <a class="trait" href="../../../spi/trait.FullDuplex.html" title="trait embedded_hal::spi::FullDuplex">FullDuplex</a><W> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Default implementation of <code>blocking::spi::Write<W></code> for implementers of <code>spi::FullDuplex<W></code></p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../../implementors/embedded_hal/blocking/spi/write/trait.Default.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
12
ch6/embedded_hal/blocking/spi/write_iter/index.html
Normal file
12
ch6/embedded_hal/blocking/spi/write_iter/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!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="Blocking write (iterator version)"><meta name="keywords" content="rust, rustlang, rust-lang, write_iter"><title>embedded_hal::blocking::spi::write_iter - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module write_iter</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="write_iter" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a class="mod" href="#">write_iter</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#80-104">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blocking write (iterator version)</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Default.html" title="embedded_hal::blocking::spi::write_iter::Default trait">Default</a></div><div class="item-right docblock-short"><p>Default implementation of <code>blocking::spi::WriteIter<W></code> for implementers of
|
||||
<code>spi::FullDuplex<W></code></p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Default","Default implementation of `blocking::spi::WriteIter<W>` for implementers of `spi::FullDuplex<W>`"]]});
|
10
ch6/embedded_hal/blocking/spi/write_iter/trait.Default.html
Normal file
10
ch6/embedded_hal/blocking/spi/write_iter/trait.Default.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!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="Default implementation of `blocking::spi::WriteIter<W>` for implementers of `spi::FullDuplex<W>`"><meta name="keywords" content="rust, rustlang, rust-lang, Default"><title>Default in embedded_hal::blocking::spi::write_iter - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Default</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::blocking::spi::write_iter</a></h2><div id="sidebar-vars" data-name="Default" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../embedded_hal/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../../index.html">embedded_hal</a>::<wbr><a href="../../index.html">blocking</a>::<wbr><a href="../index.html">spi</a>::<wbr><a href="index.html">write_iter</a>::<wbr><a class="trait" href="#">Default</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/embedded_hal/blocking/spi.rs.html#83">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Default<W>: <a class="trait" href="../../../spi/trait.FullDuplex.html" title="trait embedded_hal::spi::FullDuplex">FullDuplex</a><W> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Default implementation of <code>blocking::spi::WriteIter<W></code> for implementers of
|
||||
<code>spi::FullDuplex<W></code></p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../../implementors/embedded_hal/blocking/spi/write_iter/trait.Default.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
11
ch6/embedded_hal/capture/index.html
Normal file
11
ch6/embedded_hal/capture/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!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="Input capture"><meta name="keywords" content="rust, rustlang, rust-lang, capture"><title>embedded_hal::capture - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module capture</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="capture" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">embedded_hal</a>::<wbr><a class="mod" href="#">capture</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#1-96">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Input capture</p>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Capture.html" title="embedded_hal::capture::Capture trait">Capture</a></div><div class="item-right docblock-short"><p>Input capture</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/capture/sidebar-items.js
Normal file
1
ch6/embedded_hal/capture/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Capture","Input capture"]]});
|
63
ch6/embedded_hal/capture/trait.Capture.html
Normal file
63
ch6/embedded_hal/capture/trait.Capture.html
Normal file
@ -0,0 +1,63 @@
|
||||
<!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="Input capture"><meta name="keywords" content="rust, rustlang, rust-lang, Capture"><title>Capture in embedded_hal::capture - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Capture</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Capture">Capture</a></li><li><a href="#associatedtype.Channel">Channel</a></li><li><a href="#associatedtype.Error">Error</a></li><li><a href="#associatedtype.Time">Time</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_capture">try_capture</a></li><li><a href="#tymethod.try_disable">try_disable</a></li><li><a href="#tymethod.try_enable">try_enable</a></li><li><a href="#tymethod.try_get_resolution">try_get_resolution</a></li><li><a href="#tymethod.try_set_resolution">try_set_resolution</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::capture</a></h2><div id="sidebar-vars" data-name="Capture" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">embedded_hal</a>::<wbr><a href="index.html">capture</a>::<wbr><a class="trait" href="#">Capture</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#55-96">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Capture {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
type <a href="#associatedtype.Channel" class="associatedtype">Channel</a>;
|
||||
type <a href="#associatedtype.Time" class="associatedtype">Time</a>;
|
||||
type <a href="#associatedtype.Capture" class="associatedtype">Capture</a>;
|
||||
fn <a href="#tymethod.try_capture" class="fnname">try_capture</a>(<br> &mut self, <br> channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a><br> ) -> <a class="type" href="https://docs.rs/nb/1.0.0/nb/type.Result.html" title="type nb::Result">Result</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Capture" title="type embedded_hal::capture::Capture::Capture">Capture</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_disable" class="fnname">try_disable</a>(&mut self, channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_enable" class="fnname">try_enable</a>(&mut self, channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_get_resolution" class="fnname">try_get_resolution</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Time" title="type embedded_hal::capture::Capture::Time">Time</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_set_resolution" class="fnname">try_set_resolution</a><R>(<br> &mut self, <br> resolution: R<br> ) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>><br> <span class="where">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Time" title="type embedded_hal::capture::Capture::Time">Time</a>></span>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Input capture</p>
|
||||
<h2 id="examples"><a href="#examples">Examples</a></h2>
|
||||
<p>You can use this interface to measure the period of (quasi) periodic signals
|
||||
/ events</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">embedded_hal</span> <span class="kw">as</span> <span class="ident">hal</span>;
|
||||
<span class="attribute">#[<span class="ident">macro_use</span>(<span class="ident">block</span>)]</span>
|
||||
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">nb</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">hal::prelude</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">capture</span>: <span class="ident">Capture1</span> <span class="op">=</span> {
|
||||
<span class="comment">// ..</span>
|
||||
};
|
||||
|
||||
<span class="ident">capture</span>.<span class="ident">try_set_resolution</span>(<span class="number">1</span>.<span class="ident">ms</span>()).<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="kw">let</span> <span class="ident">before</span> <span class="op">=</span> <span class="macro">block!</span>(<span class="ident">capture</span>.<span class="ident">try_capture</span>(<span class="ident">Channel::_1</span>)).<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">after</span> <span class="op">=</span> <span class="macro">block!</span>(<span class="ident">capture</span>.<span class="ident">try_capture</span>(<span class="ident">Channel::_1</span>)).<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="kw">let</span> <span class="ident">period</span> <span class="op">=</span> <span class="ident">after</span>.<span class="ident">wrapping_sub</span>(<span class="ident">before</span>);
|
||||
|
||||
<span class="macro">println!</span>(<span class="string">"Period: {} ms"</span>, <span class="ident">period</span>);
|
||||
}
|
||||
</code></pre></div>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#62">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Enumeration of <code>Capture</code> errors</p>
|
||||
<p>Possible errors:</p>
|
||||
<ul>
|
||||
<li><em>overcapture</em>, the previous capture value was overwritten because it
|
||||
was not read in a timely manner</li>
|
||||
</ul>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Channel" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#68">source</a></div><h4 class="code-header">type <a href="#associatedtype.Channel" class="associatedtype">Channel</a></h4></div></summary><div class="docblock"><p>Enumeration of channels that can be used with this <code>Capture</code> interface</p>
|
||||
<p>If your <code>Capture</code> interface has no channels you can use the type <code>()</code>
|
||||
here</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Time" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#71">source</a></div><h4 class="code-header">type <a href="#associatedtype.Time" class="associatedtype">Time</a></h4></div></summary><div class="docblock"><p>A time unit that can be converted into a human time unit (e.g. seconds)</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="associatedtype.Capture" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#74">source</a></div><h4 class="code-header">type <a href="#associatedtype.Capture" class="associatedtype">Capture</a></h4></div></summary><div class="docblock"><p>The type of the value returned by <code>capture</code></p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_capture" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#81">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_capture" class="fnname">try_capture</a>(<br> &mut self, <br> channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a><br>) -> <a class="type" href="https://docs.rs/nb/1.0.0/nb/type.Result.html" title="type nb::Result">Result</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Capture" title="type embedded_hal::capture::Capture::Capture">Capture</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>></h4></div></summary><div class="docblock"><p>“Waits” for a transition in the capture <code>channel</code> and returns the value
|
||||
of counter at that instant</p>
|
||||
<p>NOTE that you must multiply the returned value by the <em>resolution</em> of
|
||||
this <code>Capture</code> interface to get a human time unit (e.g. seconds)</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_disable" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#84">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_disable" class="fnname">try_disable</a>(&mut self, channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>></h4></div></summary><div class="docblock"><p>Disables a capture <code>channel</code></p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_enable" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#87">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_enable" class="fnname">try_enable</a>(&mut self, channel: Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Channel" title="type embedded_hal::capture::Capture::Channel">Channel</a>) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>></h4></div></summary><div class="docblock"><p>Enables a capture <code>channel</code></p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_get_resolution" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#90">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_get_resolution" class="fnname">try_get_resolution</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Time" title="type embedded_hal::capture::Capture::Time">Time</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>></h4></div></summary><div class="docblock"><p>Returns the current resolution</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_set_resolution" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/capture.rs.html#93-95">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_set_resolution" class="fnname">try_set_resolution</a><R>(&mut self, resolution: R) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Error" title="type embedded_hal::capture::Capture::Error">Error</a>> <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><Self::<a class="associatedtype" href="trait.Capture.html#associatedtype.Time" title="type embedded_hal::capture::Capture::Time">Time</a>>, </span></h4></div></summary><div class="docblock"><p>Sets the resolution of the capture timer</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/embedded_hal/capture/trait.Capture.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
17
ch6/embedded_hal/digital/index.html
Normal file
17
ch6/embedded_hal/digital/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!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="Digital I/O"><meta name="keywords" content="rust, rustlang, rust-lang, digital"><title>embedded_hal::digital - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module digital</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="digital" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">embedded_hal</a>::<wbr><a class="mod" href="#">digital</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#1-125">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Digital I/O</p>
|
||||
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="toggleable/index.html" title="embedded_hal::digital::toggleable mod">toggleable</a></div><div class="item-right docblock-short"><p>If you can read <strong>and</strong> write the output state, a pin is
|
||||
toggleable by software.</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.InputPin.html" title="embedded_hal::digital::InputPin trait">InputPin</a></div><div class="item-right docblock-short"><p>Single digital input pin</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.OutputPin.html" title="embedded_hal::digital::OutputPin trait">OutputPin</a></div><div class="item-right docblock-short"><p>Single digital push-pull output pin</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.StatefulOutputPin.html" title="embedded_hal::digital::StatefulOutputPin trait">StatefulOutputPin</a></div><div class="item-right docblock-short"><p>Push-pull output pin that can read its output state</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ToggleableOutputPin.html" title="embedded_hal::digital::ToggleableOutputPin trait">ToggleableOutputPin</a></div><div class="item-right docblock-short"><p>Output pin that can be toggled</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/digital/sidebar-items.js
Normal file
1
ch6/embedded_hal/digital/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"mod":[["toggleable","If you can read and write the output state, a pin is toggleable by software."]],"trait":[["InputPin","Single digital input pin"],["OutputPin","Single digital push-pull output pin"],["StatefulOutputPin","Push-pull output pin that can read its output state"],["ToggleableOutputPin","Output pin that can be toggled"]]});
|
52
ch6/embedded_hal/digital/toggleable/index.html
Normal file
52
ch6/embedded_hal/digital/toggleable/index.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!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="If you can read and write the output state, a pin is toggleable by software."><meta name="keywords" content="rust, rustlang, rust-lang, toggleable"><title>embedded_hal::digital::toggleable - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module toggleable</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#traits">Traits</a></li></ul></div></section><div id="sidebar-vars" data-name="toggleable" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">digital</a>::<wbr><a class="mod" href="#">toggleable</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/digital.rs.html#92-113">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>If you can read <strong>and</strong> write the output state, a pin is
|
||||
toggleable by software.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">embedded_hal::digital</span>::{<span class="ident">OutputPin</span>, <span class="ident">StatefulOutputPin</span>, <span class="ident">ToggleableOutputPin</span>};
|
||||
<span class="kw">use</span> <span class="ident">embedded_hal::digital::toggleable</span>;
|
||||
<span class="kw">use</span> <span class="ident">core::convert::Infallible</span>;
|
||||
|
||||
<span class="doccomment">/// A virtual output pin that exists purely in software</span>
|
||||
<span class="kw">struct</span> <span class="ident">MyPin</span> {
|
||||
<span class="ident">state</span>: <span class="ident">bool</span>
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">OutputPin</span> <span class="kw">for</span> <span class="ident">MyPin</span> {
|
||||
<span class="kw">type</span> <span class="ident">Error</span> <span class="op">=</span> <span class="ident">Infallible</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">try_set_low</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident"><span class="self">Self</span>::Error</span><span class="op">></span> {
|
||||
<span class="self">self</span>.<span class="ident">state</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
<span class="kw">fn</span> <span class="ident">try_set_high</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident"><span class="self">Self</span>::Error</span><span class="op">></span> {
|
||||
<span class="self">self</span>.<span class="ident">state</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">StatefulOutputPin</span> <span class="kw">for</span> <span class="ident">MyPin</span> {
|
||||
<span class="kw">fn</span> <span class="ident">try_is_set_low</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident"><span class="self">Self</span>::Error</span><span class="op">></span> {
|
||||
<span class="prelude-val">Ok</span>(<span class="op">!</span><span class="self">self</span>.<span class="ident">state</span>)
|
||||
}
|
||||
<span class="kw">fn</span> <span class="ident">try_is_set_high</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">bool</span>, <span class="ident"><span class="self">Self</span>::Error</span><span class="op">></span> {
|
||||
<span class="prelude-val">Ok</span>(<span class="self">self</span>.<span class="ident">state</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Opt-in to the software implementation.</span>
|
||||
<span class="kw">impl</span> <span class="ident">toggleable::Default</span> <span class="kw">for</span> <span class="ident">MyPin</span> {}
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">pin</span> <span class="op">=</span> <span class="ident">MyPin</span> { <span class="ident">state</span>: <span class="bool-val">false</span> };
|
||||
<span class="ident">pin</span>.<span class="ident">try_toggle</span>().<span class="ident">unwrap</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">pin</span>.<span class="ident">try_is_set_high</span>().<span class="ident">unwrap</span>());
|
||||
<span class="ident">pin</span>.<span class="ident">try_toggle</span>().<span class="ident">unwrap</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">pin</span>.<span class="ident">try_is_set_low</span>().<span class="ident">unwrap</span>());</code></pre></div>
|
||||
</div></details><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Default.html" title="embedded_hal::digital::toggleable::Default trait">Default</a></div><div class="item-right docblock-short"><p>Software-driven <code>toggle()</code> implementation.</p>
|
||||
</div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
1
ch6/embedded_hal/digital/toggleable/sidebar-items.js
Normal file
1
ch6/embedded_hal/digital/toggleable/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["Default","Software-driven `toggle()` implementation."]]});
|
9
ch6/embedded_hal/digital/toggleable/trait.Default.html
Normal file
9
ch6/embedded_hal/digital/toggleable/trait.Default.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!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="Software-driven `toggle()` implementation."><meta name="keywords" content="rust, rustlang, rust-lang, Default"><title>Default in embedded_hal::digital::toggleable - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><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="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Default</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::digital::toggleable</a></h2><div id="sidebar-vars" data-name="Default" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../embedded_hal/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../index.html">embedded_hal</a>::<wbr><a href="../index.html">digital</a>::<wbr><a href="index.html">toggleable</a>::<wbr><a class="trait" href="#">Default</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/embedded_hal/digital.rs.html#96">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Default: <a class="trait" href="../trait.OutputPin.html" title="trait embedded_hal::digital::OutputPin">OutputPin</a> + <a class="trait" href="../trait.StatefulOutputPin.html" title="trait embedded_hal::digital::StatefulOutputPin">StatefulOutputPin</a> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Software-driven <code>toggle()</code> implementation.</p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../../implementors/embedded_hal/digital/toggleable/trait.Default.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
16
ch6/embedded_hal/digital/trait.InputPin.html
Normal file
16
ch6/embedded_hal/digital/trait.InputPin.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!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="Single digital input pin"><meta name="keywords" content="rust, rustlang, rust-lang, InputPin"><title>InputPin in embedded_hal::digital - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">InputPin</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_is_high">try_is_high</a></li><li><a href="#tymethod.try_is_low">try_is_low</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::digital</a></h2><div id="sidebar-vars" data-name="InputPin" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">embedded_hal</a>::<wbr><a href="index.html">digital</a>::<wbr><a class="trait" href="#">InputPin</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#116-125">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait InputPin {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_is_high" class="fnname">try_is_high</a>(&self) -> <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/core/primitive.bool.html">bool</a>, Self::<a class="associatedtype" href="trait.InputPin.html#associatedtype.Error" title="type embedded_hal::digital::InputPin::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_is_low" class="fnname">try_is_low</a>(&self) -> <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/core/primitive.bool.html">bool</a>, Self::<a class="associatedtype" href="trait.InputPin.html#associatedtype.Error" title="type embedded_hal::digital::InputPin::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Single digital input pin</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#118">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_is_high" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#121">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_is_high" class="fnname">try_is_high</a>(&self) -> <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/core/primitive.bool.html">bool</a>, Self::<a class="associatedtype" href="trait.InputPin.html#associatedtype.Error" title="type embedded_hal::digital::InputPin::Error">Error</a>></h4></div></summary><div class="docblock"><p>Is the input pin high?</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_is_low" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#124">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_is_low" class="fnname">try_is_low</a>(&self) -> <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/core/primitive.bool.html">bool</a>, Self::<a class="associatedtype" href="trait.InputPin.html#associatedtype.Error" title="type embedded_hal::digital::InputPin::Error">Error</a>></h4></div></summary><div class="docblock"><p>Is the input pin low?</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/embedded_hal/digital/trait.InputPin.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
20
ch6/embedded_hal/digital/trait.OutputPin.html
Normal file
20
ch6/embedded_hal/digital/trait.OutputPin.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!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="Single digital push-pull output pin"><meta name="keywords" content="rust, rustlang, rust-lang, OutputPin"><title>OutputPin in embedded_hal::digital - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><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="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script src="../../crates.js"></script><script defer src="../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"></h2>
|
||||
</nav>
|
||||
<nav class="sidebar"><a class="sidebar-logo" href="../../embedded_hal/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">OutputPin</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#associated-types">Associated Types</a></h3><ul><li><a href="#associatedtype.Error">Error</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.try_set_high">try_set_high</a></li><li><a href="#tymethod.try_set_low">try_set_low</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In embedded_hal::digital</a></h2><div id="sidebar-vars" data-name="OutputPin" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../embedded_hal/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="22" height="22" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../index.html">embedded_hal</a>::<wbr><a href="index.html">digital</a>::<wbr><a class="trait" href="#">OutputPin</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#4-19">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait OutputPin {
|
||||
type <a href="#associatedtype.Error" class="associatedtype">Error</a>;
|
||||
fn <a href="#tymethod.try_set_low" class="fnname">try_set_low</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.OutputPin.html#associatedtype.Error" title="type embedded_hal::digital::OutputPin::Error">Error</a>>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.try_set_high" class="fnname">try_set_high</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.OutputPin.html#associatedtype.Error" title="type embedded_hal::digital::OutputPin::Error">Error</a>>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Single digital push-pull output pin</p>
|
||||
</div></details><h2 id="associated-types" class="small-section-header">Associated Types<a href="#associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#6">source</a></div><h4 class="code-header">type <a href="#associatedtype.Error" class="associatedtype">Error</a></h4></div></summary><div class="docblock"><p>Error type</p>
|
||||
</div></details></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.try_set_low" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#12">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_set_low" class="fnname">try_set_low</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.OutputPin.html#associatedtype.Error" title="type embedded_hal::digital::OutputPin::Error">Error</a>></h4></div></summary><div class="docblock"><p>Drives the pin low</p>
|
||||
<p><em>NOTE</em> the actual electrical state of the pin may not actually be low, e.g. due to external
|
||||
electrical sources</p>
|
||||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.try_set_high" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/embedded_hal/digital.rs.html#18">source</a></div><h4 class="code-header">fn <a href="#tymethod.try_set_high" class="fnname">try_set_high</a>(&mut self) -> <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/core/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.OutputPin.html#associatedtype.Error" title="type embedded_hal::digital::OutputPin::Error">Error</a>></h4></div></summary><div class="docblock"><p>Drives the pin high</p>
|
||||
<p><em>NOTE</em> the actual electrical state of the pin may not actually be high, e.g. due to external
|
||||
electrical sources</p>
|
||||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/embedded_hal/digital/trait.OutputPin.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="embedded_hal" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.62.0-nightly (1f7fb6413 2022-04-10)" ></div>
|
||||
</body></html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user