<!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="SideAndOrderTree is a storage optimization, so we don’t need two bytes for the data"><metaname="keywords"content="rust, rustlang, rust-lang, SideAndOrderTree"><title>SideAndOrderTree 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 enum"><!--[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="#">SideAndOrderTree</a></h2><divclass="sidebar-elems"><section><divclass="block"><h3class="sidebar-title"><ahref="#variants">Variants</a></h3><ul><li><ahref="#variant.AskFixed">AskFixed</a></li><li><ahref="#variant.AskOraclePegged">AskOraclePegged</a></li><li><ahref="#variant.BidFixed">BidFixed</a></li><li><ahref="#variant.BidOraclePegged">BidOraclePegged</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#implementations">Methods</a></h3><ul><li><ahref="#method.new">new</a></li><li><ahref="#method.order_tree">order_tree</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-BorshDeserialize-for-SideAndOrderTree">BorshDeserialize</a></li><li><ahref="#impl-BorshSerialize-for-SideAndOrderTree">BorshSerialize</a></li><li><ahref="#impl-Clone-for-SideAndOrderTree">Clone</a></li><li><ahref="#impl-Copy-for-SideAndOrderTree">Copy</a></li><li><ahref="#impl-Debug-for-SideAndOrderTree">Debug</a></li><li><ahref="#impl-Eq-for-SideAndOrderTree">Eq</a></li><li><ahref="#impl-From%3CSideAndOrderTree%3E-for-u8">From<SideAndOrderTree></a></li><li><ahref="#impl-PartialEq%3CSideAndOrderTree%3E-for-SideAndOrderTree">PartialEq<SideAndOrderTree></a></li><li><ahref="#impl-StructuralEq-for-SideAndOrderTree">StructuralEq</a></li><li><ahref="#impl-StructuralPartialEq-for-SideAndOrderTree">StructuralPartialEq</a></li><li><ahref="#impl-TryFrom%3Cu8%3E-for-SideAndOrderTree">TryFrom<u8></a></li><li><ahref="#impl-TryFromPrimitive-for-SideAndOrderTree">TryFromPrimitive</a></li></ul></div><divclass="
}</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>SideAndOrderTree is a storage optimization, so we don’t need two bytes for the data</p>
by <code>==</code>. <ahref="https://doc.rust-lang.org/1.65.0/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.ne"class="method trait-impl has-srclink"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="srclink"href="https://doc.rust-lang.org/1.65.0/src/core/cmp.rs.html#236">source</a></span><ahref="#method.ne"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.65.0/core/cmp/trait.PartialEq.html#method.ne"class="fnname">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.reference.html">&</a>Rhs) -><aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <ahref="https://doc.rust-lang.org/1.65.0/core/cmp/trait.PartialEq.html#method.ne">Read more</a></div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-TryFrom%3Cu8%3E-for-SideAndOrderTree"class="impl has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/order_type.rs.html#167">source</a><ahref="#impl-TryFrom%3Cu8%3E-for-SideAndOrderTree"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.65.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><<aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u8.html">u8</a>> for <aclass="enum"href="enum.SideAndOrderTree.html"title="enum mango_v4::state::SideAndOrderTree">SideAndOrderTree</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl has-srclink"><ahref="#associatedtype.Error"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.65.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = TryFromPrimitiveError<<aclass="enum"href="enum.SideAndOrderTree.html"title="enum mango_v4::state::SideAndOrderTree">SideAndOrderTree</a>></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/order_type.rs.html#167">source</a><ahref="#method.try_from"class="anchor"></a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.65.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(number: <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u8.html">u8</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><Self, TryFromPrimitiveError<Self>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-TryFromPrimitive-for-SideAndOrderTree"class="impl has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/order_type.rs.html#167">source</a><ahref="#impl-TryFromPrimitive-for-SideAndOrderTree"class="anchor"></a><h3class="code-header in-band">impl TryFromPrimitive for <aclass="enum"href="enum.SideAndOrderTree.html"title="enum mango_v4::state::SideAndOrderTree">SideAndOrderTree</a></h3></section></summary><divclass="impl-items"><sectionid="associatedtype.Primitive"class="associatedtype trait-impl has-srclink"><ahref="#associatedtype.Primitive"class="anchor"></a><h4class="code-header">type <aclass="associatedtype">Primitive</a> = <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.u8.html">u8</a></h4></section><sectionid="associatedconstant.NAME"class="associatedconstant trait-impl has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/order_type.rs.html#167">source</a><ahref="#associatedconstant.NAME"class="anchor"></a><h4class="code-header">const <aclass="constant">NAME</a>: &'static <aclass="primitive"href="https://doc.rust-lang.org/1.65.0/std/primitive.str.html">str</a> = _</h4></section><sectionid="method.try_from_primitive"class="method trait-impl has-srclink"><aclass="srclink rightside"href="../../src/mango_v4/state/orderbook/order_type.rs.html#167">source</a><ahref="#method.try_from_primitive"class="anchor"></a><h4class="code-header">fn <aclass="fnname">try_from_primitive</a>(<br> number: Self::Primitive<br>) -><aclass="enum"href="https://doc.rust-lang.org/1.65.0/core/res
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><sectionid="impl-Instrument-for-SideAndOrderTree"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-SideAndOrderTree"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