librustzcash/rustdoc/latest/zcash_client_backend/data_api/trait.Account.html

26 lines
20 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 set of capabilities that a client account must provide."><title>Account in zcash_client_backend::data_api - 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-20739d33.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="zcash_client_backend" data-themes="" data-resource-suffix="" data-rustdoc-version="1.88.0-nightly (74509131e 2025-04-29)" 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-7ef8a74a.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.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_client_backend/index.html">zcash_<wbr>client_<wbr>backend</a><span class="version">0.18.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Account</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.AccountId" title="AccountId">AccountId</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.id" title="id">id</a></li><li><a href="#tymethod.name" title="name">name</a></li><li><a href="#tymethod.source" title="source">source</a></li><li><a href="#tymethod.ufvk" title="ufvk">ufvk</a></li><li><a href="#tymethod.uivk" title="uivk">uivk</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.purpose" title="purpose">purpose</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Account-for-(A,+UnifiedFullViewingKey)" title="(A, UnifiedFullViewingKey)">(A, UnifiedFullViewingKey)</a></li><li><a href="#impl-Account-for-(A,+UnifiedIncomingViewingKey)" title="(A, UnifiedIncomingViewingKey)">(A, UnifiedIncomingViewingKey)</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In zcash_<wbr>client_<wbr>backend::<wbr>data_<wbr>api</a></h2></div></div></nav><div class="sidebar-resizer"></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_client_backend</a>::<wbr><a href="index.html">data_api</a></div><h1>Trait <span class="trait">Account</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_client_backend/data_api.rs.html#411-446">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Account {
type <a href="#associatedtype.AccountId" class="associatedtype">AccountId</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>;
// Required methods
fn <a href="#tymethod.id" class="fn">id</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Account.html#associatedtype.AccountId" title="type zcash_client_backend::data_api::Account::AccountId">AccountId</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.source" class="fn">source</a>(&amp;self) -&gt; &amp;<a class="enum" href="enum.AccountSource.html" title="enum zcash_client_backend::data_api::AccountSource">AccountSource</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.ufvk" class="fn">ufvk</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey">UnifiedFullViewingKey</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.uivk" class="fn">uivk</a>(&amp;self) -&gt; <a class="struct" href="../keys/struct.UnifiedIncomingViewingKey.html" title="struct zcash_client_backend::keys::UnifiedIncomingViewingKey">UnifiedIncomingViewingKey</a>;
// Provided method
fn <a href="#method.purpose" class="fn">purpose</a>(&amp;self) -&gt; <a class="enum" href="enum.AccountPurpose.html" title="enum zcash_client_backend::data_api::AccountPurpose">AccountPurpose</a> { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A set of capabilities that a client account must provide.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.AccountId" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#412">Source</a><h4 class="code-header">type <a href="#associatedtype.AccountId" class="associatedtype">AccountId</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a></h4></section></div><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.id" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#415">Source</a><h4 class="code-header">fn <a href="#tymethod.id" class="fn">id</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Account.html#associatedtype.AccountId" title="type zcash_client_backend::data_api::Account::AccountId">AccountId</a></h4></section></summary><div class="docblock"><p>Returns the unique identifier for the account.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.name" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#418">Source</a><h4 class="code-header">fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the human-readable name for the account, if any has been configured.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.source" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#422">Source</a><h4 class="code-header">fn <a href="#tymethod.source" class="fn">source</a>(&amp;self) -&gt; &amp;<a class="enum" href="enum.AccountSource.html" title="enum zcash_client_backend::data_api::AccountSource">AccountSource</a></h4></section></summary><div class="docblock"><p>Returns whether this account is derived or imported, and the derivation parameters
if applicable.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.ufvk" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#438">Source</a><h4 class="code-header">fn <a href="#tymethod.ufvk" class="fn">ufvk</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey">UnifiedFullViewingKey</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the UFVK that the wallet backend has stored for the account, if any.</p>
<p>Accounts for which this returns <code>None</code> cannot be used in wallet contexts, because
they are unable to maintain an accurate balance.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.uivk" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#445">Source</a><h4 class="code-header">fn <a href="#tymethod.uivk" class="fn">uivk</a>(&amp;self) -&gt; <a class="struct" href="../keys/struct.UnifiedIncomingViewingKey.html" title="struct zcash_client_backend::keys::UnifiedIncomingViewingKey">UnifiedIncomingViewingKey</a></h4></section></summary><div class="docblock"><p>Returns the UIVK that the wallet backend has stored for the account.</p>
<p>All accounts are required to have at least an incoming viewing key. This gives no
indication about whether an account can be used in a wallet context; for that, use
<a href="trait.Account.html#tymethod.ufvk" title="method zcash_client_backend::data_api::Account::ufvk"><code>Account::ufvk</code></a>.</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.purpose" class="method"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#425-432">Source</a><h4 class="code-header">fn <a href="#method.purpose" class="fn">purpose</a>(&amp;self) -&gt; <a class="enum" href="enum.AccountPurpose.html" title="enum zcash_client_backend::data_api::AccountPurpose">AccountPurpose</a></h4></section></summary><div class="docblock"><p>Returns whether the account is a spending account or a view-only account.</p>
</div></details></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-Account-for-(A,+UnifiedFullViewingKey)" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#449-474">Source</a><a href="#impl-Account-for-(A,+UnifiedFullViewingKey)" class="anchor">§</a><h3 class="code-header">impl&lt;A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; <a class="trait" href="trait.Account.html" title="trait zcash_client_backend::data_api::Account">Account</a> for (A, <a class="struct" href="../keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey">UnifiedFullViewingKey</a>)</h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-dependencies</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="associatedtype.AccountId-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#450">Source</a><a href="#associatedtype.AccountId-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.AccountId" class="associatedtype">AccountId</a> = A</h4></section><section id="method.id" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#452-454">Source</a><a href="#method.id" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.id" class="fn">id</a>(&amp;self) -&gt; A</h4></section><section id="method.source" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#456-461">Source</a><a href="#method.source" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.source" class="fn">source</a>(&amp;self) -&gt; &amp;<a class="enum" href="enum.AccountSource.html" title="enum zcash_client_backend::data_api::AccountSource">AccountSource</a></h4></section><section id="method.ufvk" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#463-465">Source</a><a href="#method.ufvk" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.ufvk" class="fn">ufvk</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey">UnifiedFullViewingKey</a>&gt;</h4></section><section id="method.uivk" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#467-469">Source</a><a href="#method.uivk" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.uivk" class="fn">uivk</a>(&amp;self) -&gt; <a class="struct" href="../keys/struct.UnifiedIncomingViewingKey.html" title="struct zcash_client_backend::keys::UnifiedIncomingViewingKey">UnifiedIncomingViewingKey</a></h4></section><section id="method.name" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#471-473">Source</a><a href="#method.name" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Account-for-(A,+UnifiedIncomingViewingKey)" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#477-502">Source</a><a href="#impl-Account-for-(A,+UnifiedIncomingViewingKey)" class="anchor">§</a><h3 class="code-header">impl&lt;A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>&gt; <a class="trait" href="trait.Account.html" title="trait zcash_client_backend::data_api::Account">Account</a> for (A, <a class="struct" href="../keys/struct.UnifiedIncomingViewingKey.html" title="struct zcash_client_backend::keys::UnifiedIncomingViewingKey">UnifiedIncomingViewingKey</a>)</h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-dependencies</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="associatedtype.AccountId-2" class="associatedtype trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#478">Source</a><a href="#associatedtype.AccountId-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.AccountId" class="associatedtype">AccountId</a> = A</h4></section><section id="method.id-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#480-482">Source</a><a href="#method.id-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.id" class="fn">id</a>(&amp;self) -&gt; A</h4></section><section id="method.name-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#484-486">Source</a><a href="#method.name-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</h4></section><section id="method.source-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#488-493">Source</a><a href="#method.source-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.source" class="fn">source</a>(&amp;self) -&gt; &amp;<a class="enum" href="enum.AccountSource.html" title="enum zcash_client_backend::data_api::AccountSource">AccountSource</a></h4></section><section id="method.ufvk-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#495-497">Source</a><a href="#method.ufvk-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.ufvk" class="fn">ufvk</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="struct" href="../keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey">UnifiedFullViewingKey</a>&gt;</h4></section><section id="method.uivk-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api.rs.html#499-501">Source</a><a href="#method.uivk-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.uivk" class="fn">uivk</a>(&amp;self) -&gt; <a class="struct" href="../keys/struct.UnifiedIncomingViewingKey.html" title="struct zcash_client_backend::keys::UnifiedIncomingViewingKey">UnifiedIncomingViewingKey</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Account-for-TestAccount%3CA%3E" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api/testing.rs.html#384-406">Source</a><a href="#impl-Account-for-TestAccount%3CA%3E" class="anchor">§</a><h3 class="code-header">impl&lt;A: <a class="trait" href="trait.Account.html" title="trait zcash_client_backend::data_api::Account">Account</a>&gt; <a class="trait" href="trait.Account.html" title="trait zcash_client_backend::data_api::Account">Account</a> for <a class="struct" href="testing/struct.TestAccount.html" title="struct zcash_client_backend::data_api::testing::TestAccount">TestAccount</a>&lt;A&gt;</h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>test-dependencies</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="associatedtype.AccountId-3" class="associatedtype trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/data_api/testing.rs.html#385">Source</a><a href="#associatedtype.AccountId-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.AccountId" class="associatedtype">AccountId</a> = &lt;A as <a class="trait" href="trait.Account.html" title="trait zcash_client_backend::data_api::Account">Account</a>&gt;::<a class="associatedtype" href="trait.Account.html#associatedtype.AccountId" title="type zcash_client_backend::data_api::Account::AccountId">AccountId</a></h4></section></div></details></div><script src="../../trait.impl/zcash_client_backend/data_api/trait.Account.js" data-ignore-extern-crates="std" async></script></section></div></main></body></html>