<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `BookSide` struct in crate `mango_v4`."><metaname="keywords"content="rust, rustlang, rust-lang, BookSide"><title>BookSide in mango_v4::state - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceSerif4-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../FiraSans-Regular.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../FiraSans-Medium.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceCodePro-Regular.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceSerif4-Bold.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../SourceCodePro-Semibold.ttf.woff2"><linkrel="stylesheet"href="../../normalize.css"><linkrel="stylesheet"href="../../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"href="../../ayu.css"disabled><linkrel="stylesheet"href="../../dark.css"disabled><linkrel="stylesheet"href="../../light.css"id="themeStyle"><scriptid="default-settings"></script><scriptsrc="../../storage.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../main.js"></script><noscript><linkrel="stylesheet"href="../../noscript.css"></noscript><linkrel="alternate icon"type="image/png"href="../../favicon-16x16.png"><linkrel="alternate icon"type="image/png"href="../../favicon-32x32.png"><linkrel="icon"type="image/svg+xml"href="../../favicon.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../../mango_v4/index.html"><divclass="logo-container"><imgclass="rust-logo"src="../../rust-logo.svg"alt="logo"></div></a><h2class="location"></h2></nav><navclass="sidebar"><aclass="sidebar-logo"href="../../mango_v4/index.html"><divclass="logo-container"><imgclass="rust-logo"src="../../rust-logo.svg"alt="logo"></div></a><h2class="location"><ahref="#">BookSide</a></h2><divclass="sidebar-elems"><section><divclass="block"><h3class="sidebar-title"><ahref="#fields">Fields</a></h3><ul><li><ahref="#structfield.nodes">nodes</a></li><li><ahref="#structfield.reserved">reserved</a></li><li><ahref="#structfield.reserved_roots">reserved_roots</a></li><li><ahref="#structfield.roots">roots</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#implementations">Methods</a></h3><ul><li><ahref="#method.best_price">best_price</a></li><li><ahref="#method.impact_price">impact_price</a></li><li><ahref="#method.insert_leaf">insert_leaf</a></li><li><ahref="#method.is_full">is_full</a></li><li><ahref="#method.iter_all_including_invalid">iter_all_including_invalid</a></li><li><ahref="#method.iter_valid">iter_valid</a></li><li><ahref="#method.node">node</a></li><li><ahref="#method.node_mut">node_mut</a></li><li><ahref="#method.quantity_at_price">quantity_at_price</a></li><li><ahref="#method.remove_by_key">remove_by_key</a></li><li><ahref="#method.remove_one_expired">remove_one_expired</a></li><li><ahref="#method.remove_worst">remove_worst</a></li><li><ahref="#method.root">root</a></li><li><ahref="#method.root_mut">root_mut</a></li><li><ahref="#method.side">side</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#trait-implementations">Trait Implementations</a></h3><ul><li><ahref="#impl-AccountDeserialize-for-BookSide">AccountDeserialize</a></li><li><ahref="#impl-Clone-for-BookSide">Clone</a></li><li><ahref="#impl-Copy-for-BookSide">Copy</a></li><li><ahref="#impl-Discriminator-for-BookSide">Discriminator</a></li><li><ahref="#impl-Owner-for-BookSide">Owner</a></li><li><ahref="#impl-Pod-for-B
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.remove_one_expired"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#113-129">source</a><h4class="code-header">pub fn <ahref="#method.remove_one_expired"class="fnname">remove_one_expired</a>(<br> &mut self,<br> component: <aclass="enum"href="enum.BookSideOrderTree.html"title="enum mango_v4::state::BookSideOrderTree">BookSideOrderTree</a>,<br> now_ts: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u64.html">u64</a><br>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="struct.LeafNode.html"title="struct mango_v4::state::LeafNode">LeafNode</a>></h4></section></summary><divclass="docblock"><p>Remove the order with the lowest expiry timestamp in the component, if that’s < now_ts.
</div></details><sectionid="method.remove_by_key"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#131-138">source</a><h4class="code-header">pub fn <ahref="#method.remove_by_key"class="fnname">remove_by_key</a>(<br> &mut self,<br> component: <aclass="enum"href="enum.BookSideOrderTree.html"title="enum mango_v4::state::BookSideOrderTree">BookSideOrderTree</a>,<br> search_key: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u128.html">u128</a><br>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="struct.LeafNode.html"title="struct mango_v4::state::LeafNode">LeafNode</a>></h4></section><sectionid="method.side"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#140-142">source</a><h4class="code-header">pub fn <ahref="#method.side"class="fnname">side</a>(&self) -><aclass="enum"href="enum.Side.html"title="enum mango_v4::state::Side">Side</a></h4></section><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.quantity_at_price"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#145-160">source</a><h4class="code-header">pub fn <ahref="#method.quantity_at_price"class="fnname">quantity_at_price</a>(<br> &self,<br> limit_price_lots: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a>,<br> now_ts: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u64.html">u64</a>,<br> oracle_price_lots: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a><br>) -><aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a></h4></section></summary><divclass="docblock"><p>Return the quantity of orders that can be matched by an order at <code>limit_price_lots</code></p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.best_price"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#163-169">source</a><h4class="code-header">pub fn <ahref="#method.best_price"class="fnname">best_price</a>(&self, now_ts: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u64.html">u64</a>, oracle_price_lots: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a>></h4></section></summary><divclass="docblock"><p>Return the price of the order closest to the spread</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.impact_price"class="method has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/bookside.rs.html#173-182">source</a><h4class="code-header">pub fn <ahref="#method.impact_price"class="fnname">impact_price</a>(<br> &self,<br> quantity: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a>,<br> now_ts: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u64.html">u64</a>,<br> oracle_price_lots: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a><br>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.i64.html">i64</a>></h4></section></summary><divclass="docblock"><p>Walk up the book <code>quantity</code> units and return the price at that level. If <code>quantity</code> units
<ahref="CheckedBitPattern::is_valid_bit_pattern"><code>is_valid_bit_pattern</code></a>. <a>Read more</a></div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.is_valid_bit_pattern"class="method trait-impl has-srclink"><ahref="#method.is_valid_bit_pattern"class="anchor"></a><h4class="code-header">fn <aclass="fnname">is_valid_bit_pattern</a>(_bits: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.reference.html">&</a>T) -><aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>If this function returns true, then it must be valid to reinterpret <code>bits</code>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-Instrument-for-BookSide"class="impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276">source</a><ahref="#impl-Instrument-for-BookSide"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html"title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.instrument"class="method trait-impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82">source</a><ahref="#method.instrument"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument"class="fnname">instrument</a>(self, span: <aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the provided <ahref="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"title="Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method trait-impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121">source</a><ahref="#method.in_current_span"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span"class="fnname">in_current_span</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the <ahref="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current">current</a><ahref="https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html"><code>Span</code></a>, returning an
<ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html"title="WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221">source</a><ahref="#method.with_current_subscriber"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fnname">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'>Attaches the current <ahref="https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a><ahref="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
<ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html"title="WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-WrappingAs-for-BookSide"class="impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/az/~1.2/src/az/lib.rs.html#818">source</a><ahref="#impl-WrappingAs-for-BookSide"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="https://docs.rs/az/~1.2/az/trait.WrappingAs.html"title="trait az::WrappingAs">WrappingAs</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.wrapping_as"class="method trait-impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/az/~1.2/src/az/lib.rs.html#821-823">source</a><ahref="#method.wrapping_as"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/az/~1.2/az/trait.WrappingAs.html#tymethod.wrapping_as"class="fnname">wrapping_as</a><Dst>(self) -> Dst<spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://docs.rs/az/~1.2/az/trait.WrappingCast.html"title="trait az::WrappingCast">WrappingCast</a><Dst>,</span></h4></section></summary><divclass='docblock'>Casts the value.</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-WrappingCastFrom%3CSrc%3E-for-BookSide"class="impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/az/~1.2/src/az/lib.rs.html#438">source</a><ahref="#impl-WrappingCastFrom%3CSrc%3E-for-BookSide"class="anchor"></a><h3class="code-header in-band">impl<Src, Dst><aclass="trait"href="https://docs.rs/az/~1.2/az/trait.WrappingCastFrom.html"title="trait az::WrappingCastFrom">WrappingCastFrom</a><Src> for Dst<spanclass="where fmt-newline">where<br> Src: <aclass="trait"href="https://docs.rs/az/~1.2/az/trait.WrappingCast.html"title="trait az::WrappingCast">WrappingCast</a><Dst>,</span></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.wrapping_cast_from"class="method trait-impl has-srclink"><aclass="srclink rightside"href="https://docs.rs/az/~1.2/src/az/lib.rs.html#441">source</a><ahref="#method.wrapping_cast_from"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/az/~1.2/az/trait.WrappingCastFrom.html#tymethod.wrapping_cast_from"class="fnname">wrapping_cast_from</a>(src: Src) -> Dst</h4></section></summary><divclass='docblock'>Casts the value.</div></details></div></details><sectionid="impl-AnyBitPattern-for-BookSide"class="impl has-srclink"><ahref="#impl-AnyBitPattern-for-BookSide"class="anchor"></a><h3class="code-header in-band">impl<T> AnyBitPattern for T<spanclass="where fmt-newline">where<br> T: Pod,</span></h3></section><sectionid="impl-NoUninit-for-BookSide"class="impl has-srclink"><ahref="#impl-NoUninit-for-BookSide"class="anchor"></a><h3class="code-header in-band">impl<T> NoUninit for T<spanclass="where fmt-newline">where<br> T: Pod,</span></h3></section></div></section></div></main><divid="rustdoc-vars"data-root-path="../../"data-current-crate="mango_v4"data-themes="ayu,dark,light"data-resource-suffix=""data-rustdoc-version="1.65.0 (897e37553 2022-11-02)"></div></body></html>