mirror of https://github.com/zcash/halo2.git
37 lines
11 KiB
HTML
37 lines
11 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="A chip implements a set of instructions that can be used by gadgets."><title>Chip in halo2_proofs::circuit - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-1def573a4779b29b.css" id="mainThemeStyle"><link rel="stylesheet" id="themeStyle" href="../../static.files/light-d59023bfa12059d2.css"><link rel="stylesheet" disabled href="../../static.files/dark-1ca41bb1e10af075.css"><link rel="stylesheet" disabled href="../../static.files/ayu-18b4181a2f3fb862.css"><script src="../../static.files/storage-3891ce972e3a2bf8.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-98a684e84ae5b08b.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-13285aec31fa243e.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
|
||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
|
||
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
|
||
<script>
|
||
document.addEventListener("DOMContentLoaded", function() {
|
||
renderMathInElement(document.body, {
|
||
delimiters: [
|
||
{left: "$$", right: "$$", display: true},
|
||
{left: "\\(", right: "\\)", display: false},
|
||
{left: "$", right: "$", display: false},
|
||
{left: "\\[", right: "\\]", display: true}
|
||
]
|
||
});
|
||
});
|
||
</script>
|
||
</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="logo-container" href="../../halo2_proofs/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../../halo2_proofs/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2 class="location"><a href="#">Chip</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Config">Config</a></li><li><a href="#associatedtype.Loaded">Loaded</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.config">config</a></li><li><a href="#tymethod.loaded">loaded</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In halo2_proofs::circuit</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">halo2_proofs</a>::<wbr><a href="index.html">circuit</a>::<wbr><a class="trait" href="#">Chip</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/halo2_proofs/circuit.rs.html#25-46">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Chip<F: <a class="trait" href="../arithmetic/trait.Field.html" title="trait halo2_proofs::arithmetic::Field">Field</a>>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||
type <a href="#associatedtype.Config" class="associatedtype">Config</a>: <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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>;
|
||
type <a href="#associatedtype.Loaded" class="associatedtype">Loaded</a>: <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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>;
|
||
|
||
// Required methods
|
||
fn <a href="#tymethod.config" class="fn">config</a>(&self) -> &Self::<a class="associatedtype" href="trait.Chip.html#associatedtype.Config" title="type halo2_proofs::circuit::Chip::Config">Config</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.loaded" class="fn">loaded</a>(&self) -> &Self::<a class="associatedtype" href="trait.Chip.html#associatedtype.Loaded" title="type halo2_proofs::circuit::Chip::Loaded">Loaded</a>;
|
||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A chip implements a set of instructions that can be used by gadgets.</p>
|
||
<p>The chip stores state that is required at circuit synthesis time in
|
||
<a href="trait.Chip.html#associatedtype.Config" title="Chip::Config"><code>Chip::Config</code></a>, which can be fetched via <a href="trait.Chip.html#tymethod.config" title="Chip::config"><code>Chip::config</code></a>.</p>
|
||
<p>The chip also loads any fixed configuration needed at synthesis time
|
||
using its own implementation of <code>load</code>, and stores it in <a href="trait.Chip.html#associatedtype.Loaded" title="Chip::Loaded"><code>Chip::Loaded</code></a>.
|
||
This can be accessed via <a href="trait.Chip.html#tymethod.loaded" title="Chip::loaded"><code>Chip::loaded</code></a>.</p>
|
||
</div></details><h2 id="required-associated-types" class="small-section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Config" class="method"><a class="srclink rightside" href="../../src/halo2_proofs/circuit.rs.html#30">source</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a>: <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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></h4></section></summary><div class="docblock"><p>A type that holds the configuration for this chip, and any other state it may need
|
||
during circuit synthesis, that can be derived during <a href="../plonk/trait.Circuit.html#tymethod.configure"><code>Circuit::configure</code></a>.</p>
|
||
</div></details><details class="toggle" open><summary><section id="associatedtype.Loaded" class="method"><a class="srclink rightside" href="../../src/halo2_proofs/circuit.rs.html#36">source</a><h4 class="code-header">type <a href="#associatedtype.Loaded" class="associatedtype">Loaded</a>: <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/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></h4></section></summary><div class="docblock"><p>A type that holds any general chip state that needs to be loaded at the start of
|
||
<a href="../plonk/trait.Circuit.html#tymethod.synthesize"><code>Circuit::synthesize</code></a>. This might simply be <code>()</code> for some chips.</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="toggle method-toggle" open><summary><section id="tymethod.config" class="method"><a class="srclink rightside" href="../../src/halo2_proofs/circuit.rs.html#39">source</a><h4 class="code-header">fn <a href="#tymethod.config" class="fn">config</a>(&self) -> &Self::<a class="associatedtype" href="trait.Chip.html#associatedtype.Config" title="type halo2_proofs::circuit::Chip::Config">Config</a></h4></section></summary><div class="docblock"><p>The chip holds its own configuration.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.loaded" class="method"><a class="srclink rightside" href="../../src/halo2_proofs/circuit.rs.html#45">source</a><h4 class="code-header">fn <a href="#tymethod.loaded" class="fn">loaded</a>(&self) -> &Self::<a class="associatedtype" href="trait.Chip.html#associatedtype.Loaded" title="type halo2_proofs::circuit::Chip::Loaded">Loaded</a></h4></section></summary><div class="docblock"><p>Provides access to general chip state loaded at the beginning of circuit
|
||
synthesis.</p>
|
||
<p>Panics if called before <code>Chip::load</code>.</p>
|
||
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../implementors/halo2_proofs/circuit/trait.Chip.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="halo2_proofs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.69.0-nightly (065852def 2023-02-13)" data-search-js="search-abe1d547ad11c273.js" data-settings-js="settings-f0c5c39777a9a2f6.js" data-settings-css="settings-0bcba95ff279c1db.css" ></div></body></html> |