librustzcash/rustdoc/latest/zcash_protocol/consensus/trait.Parameters.html

15 lines
12 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Zcash consensus parameters."><title>Parameters in zcash_protocol::consensus - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="zcash_protocol" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0-nightly (99e7c15e8 2025-06-01)" data-channel="nightly" data-search-js="search-f7877310.js" data-settings-js="settings-5514c975.js" ><script src="../../static.files/storage-4e99c027.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.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" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../zcash_protocol/index.html">zcash_<wbr>protocol</a><span class="version">0.5.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Parameters</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.activation_height" title="activation_height">activation_height</a></li><li><a href="#tymethod.network_type" title="network_type">network_type</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.is_nu_active" title="is_nu_active">is_nu_active</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Parameters-for-%26P" title="&#38;P">&#38;P</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In zcash_<wbr>protocol::<wbr>consensus</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">zcash_protocol</a>::<wbr><a href="index.html">consensus</a></div><h1>Trait <span class="trait">Parameters</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/zcash_protocol/consensus.rs.html#316-329">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Parameters: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> {
// Required methods
fn <a href="#tymethod.network_type" class="fn">network_type</a>(&amp;self) -&gt; <a class="enum" href="enum.NetworkType.html" title="enum zcash_protocol::consensus::NetworkType">NetworkType</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.activation_height" class="fn">activation_height</a>(&amp;self, nu: <a class="enum" href="enum.NetworkUpgrade.html" title="enum zcash_protocol::consensus::NetworkUpgrade">NetworkUpgrade</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.BlockHeight.html" title="struct zcash_protocol::consensus::BlockHeight">BlockHeight</a>&gt;;
// Provided method
fn <a href="#method.is_nu_active" class="fn">is_nu_active</a>(&amp;self, nu: <a class="enum" href="enum.NetworkUpgrade.html" title="enum zcash_protocol::consensus::NetworkUpgrade">NetworkUpgrade</a>, height: <a class="struct" href="struct.BlockHeight.html" title="struct zcash_protocol::consensus::BlockHeight">BlockHeight</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Zcash consensus parameters.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.network_type" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#318">Source</a><h4 class="code-header">fn <a href="#tymethod.network_type" class="fn">network_type</a>(&amp;self) -&gt; <a class="enum" href="enum.NetworkType.html" title="enum zcash_protocol::consensus::NetworkType">NetworkType</a></h4></section></summary><div class="docblock"><p>Returns the type of network configured by this set of consensus parameters.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.activation_height" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#322">Source</a><h4 class="code-header">fn <a href="#tymethod.activation_height" class="fn">activation_height</a>(&amp;self, nu: <a class="enum" href="enum.NetworkUpgrade.html" title="enum zcash_protocol::consensus::NetworkUpgrade">NetworkUpgrade</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.BlockHeight.html" title="struct zcash_protocol::consensus::BlockHeight">BlockHeight</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the activation height for a particular network upgrade,
if an activation height has been set.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.is_nu_active" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#326-328">Source</a><h4 class="code-header">fn <a href="#method.is_nu_active" class="fn">is_nu_active</a>(&amp;self, nu: <a class="enum" href="enum.NetworkUpgrade.html" title="enum zcash_protocol::consensus::NetworkUpgrade">NetworkUpgrade</a>, height: <a class="struct" href="struct.BlockHeight.html" title="struct zcash_protocol::consensus::BlockHeight">BlockHeight</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Determines whether the specified network upgrade is active as of the
provided block height on the network to which this Parameters value applies.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Parameters-for-%26P" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#331-339">Source</a><a href="#impl-Parameters-for-%26P" class="anchor">§</a><h3 class="code-header">impl&lt;P: <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a>&gt; <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;P</a></h3></section></summary><div class="impl-items"><section id="method.network_type" class="method trait-impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#332-334">Source</a><a href="#method.network_type" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.network_type" class="fn">network_type</a>(&amp;self) -&gt; <a class="enum" href="enum.NetworkType.html" title="enum zcash_protocol::consensus::NetworkType">NetworkType</a></h4></section><section id="method.activation_height" class="method trait-impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#336-338">Source</a><a href="#method.activation_height" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.activation_height" class="fn">activation_height</a>(&amp;self, nu: <a class="enum" href="enum.NetworkUpgrade.html" title="enum zcash_protocol::consensus::NetworkUpgrade">NetworkUpgrade</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.BlockHeight.html" title="struct zcash_protocol::consensus::BlockHeight">BlockHeight</a>&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Parameters-for-Network" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#463-477">Source</a><a href="#impl-Parameters-for-Network" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a> for <a class="enum" href="enum.Network.html" title="enum zcash_protocol::consensus::Network">Network</a></h3></section><section id="impl-Parameters-for-LocalNetwork" class="impl"><a class="src rightside" href="../../src/zcash_protocol/local_consensus.rs.html#50-70">Source</a><a href="#impl-Parameters-for-LocalNetwork" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a> for <a class="struct" href="../local_consensus/struct.LocalNetwork.html" title="struct zcash_protocol::local_consensus::LocalNetwork">LocalNetwork</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>local-consensus</code></strong> only.</div></span><div class="docblock"><p>Parameters implementation for <code>LocalNetwork</code></p>
</div></section><section id="impl-Parameters-for-MainNetwork" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#397-417">Source</a><a href="#impl-Parameters-for-MainNetwork" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a> for <a class="struct" href="struct.MainNetwork.html" title="struct zcash_protocol::consensus::MainNetwork">MainNetwork</a></h3></section><section id="impl-Parameters-for-TestNetwork" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#429-449">Source</a><a href="#impl-Parameters-for-TestNetwork" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a> for <a class="struct" href="struct.TestNetwork.html" title="struct zcash_protocol::consensus::TestNetwork">TestNetwork</a></h3></section></div><script src="../../trait.impl/zcash_protocol/consensus/trait.Parameters.js" async></script></section></div></main></body></html>