blob: 2ca7aa67e565a9ad050565b5d63c4f9f7fd3b6e3 [file] [log] [blame]
<!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="Generalization of caches providing access to `T`."><meta name="keywords" content="rust, rustlang, rust-lang, Access"><title>Access in arc_swap::cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.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">&#9776;</button><a class="sidebar-logo" href="../../arc_swap/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../arc_swap/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Access</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.load">load</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In arc_swap::cache</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" 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="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">arc_swap</a>::<wbr><a href="index.html">cache</a>::<wbr><a class="trait" href="#">Access</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/arc_swap/cache.rs.html#23-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait Access&lt;T&gt; {
fn <a href="#tymethod.load" class="fnname">load</a>(&amp;mut self) -&gt; &amp;T;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Generalization of caches providing access to <code>T</code>.</p>
<p>This abstracts over all kinds of caches that can provide a cheap access to values of type <code>T</code>.
This is useful in cases where some code doesn’t care if the <code>T</code> is the whole structure or just
a part of it.</p>
<p>See the example at <a href="struct.Cache.html#method.map" title="Cache::map"><code>Cache::map</code></a>.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.load" class="method has-srclink"><a class="srclink rightside" href="../../src/arc_swap/cache.rs.html#27">source</a><h4 class="code-header">fn <a href="#tymethod.load" class="fnname">load</a>(&amp;mut self) -&gt; &amp;T</h4></section></summary><div class="docblock"><p>Loads the value from cache.</p>
<p>This revalidates the value in the cache, then provides the access to the cached value.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><section id="impl-Access%3C%3CT%20as%20Deref%3E%3A%3ATarget%3E-for-Cache%3CA%2C%20T%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/arc_swap/cache.rs.html#229-238">source</a><a href="#impl-Access%3C%3CT%20as%20Deref%3E%3A%3ATarget%3E-for-Cache%3CA%2C%20T%3E" class="anchor"></a><h3 class="code-header">impl&lt;A, T, S&gt; <a class="trait" href="trait.Access.html" title="trait arc_swap::cache::Access">Access</a>&lt;&lt;T as Deref&gt;::Target&gt; for <a class="struct" href="struct.Cache.html" title="struct arc_swap::cache::Cache">Cache</a>&lt;A, T&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: Deref&lt;Target = <a class="struct" href="../struct.ArcSwapAny.html" title="struct arc_swap::ArcSwapAny">ArcSwapAny</a>&lt;T, S&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Deref&lt;Target = &lt;T as <a class="trait" href="../trait.RefCnt.html" title="trait arc_swap::RefCnt">RefCnt</a>&gt;::<a class="associatedtype" href="../trait.RefCnt.html#associatedtype.Base" title="type arc_swap::RefCnt::Base">Base</a>&gt; + <a class="trait" href="../trait.RefCnt.html" title="trait arc_swap::RefCnt">RefCnt</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../strategy/trait.Strategy.html" title="trait arc_swap::strategy::Strategy">Strategy</a>&lt;T&gt;,</span></h3></section><section id="impl-Access%3CU%3E-for-MapCache%3CA%2C%20T%2C%20F%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/arc_swap/cache.rs.html#261-271">source</a><a href="#impl-Access%3CU%3E-for-MapCache%3CA%2C%20T%2C%20F%3E" class="anchor"></a><h3 class="code-header">impl&lt;A, T, S, F, U&gt; <a class="trait" href="trait.Access.html" title="trait arc_swap::cache::Access">Access</a>&lt;U&gt; for <a class="struct" href="struct.MapCache.html" title="struct arc_swap::cache::MapCache">MapCache</a>&lt;A, T, F&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: Deref&lt;Target = <a class="struct" href="../struct.ArcSwapAny.html" title="struct arc_swap::ArcSwapAny">ArcSwapAny</a>&lt;T, S&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../trait.RefCnt.html" title="trait arc_swap::RefCnt">RefCnt</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="../strategy/trait.Strategy.html" title="trait arc_swap::strategy::Strategy">Strategy</a>&lt;T&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: FnMut(&amp;T) -&gt; &amp;U,</span></h3></section></div><script src="../../implementors/arc_swap/cache/trait.Access.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="arc_swap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>