<!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="API documentation for the Rust `Guard` struct in crate `crossbeam_epoch`."><metaname="keywords"content="rust, rustlang, rust-lang, Guard"><title>crossbeam_epoch::Guard - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptsrc="../storage.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="shortcut icon"href="../favicon.ico"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../crossbeam_epoch/index.html'><divclass='logo-container'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass='location'>Struct Guard</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#methods">Methods</a><divclass="sidebar-links"><ahref="#method.collector">collector</a><ahref="#method.defer">defer</a><ahref="#method.defer_destroy">defer_destroy</a><ahref="#method.defer_unchecked">defer_unchecked</a><ahref="#method.flush">flush</a><ahref="#method.repin">repin</a><ahref="#method.repin_after">repin_after</a></div><aclass="sidebar-title"href="#implementations">Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-Debug">Debug</a><ahref="#impl-Drop">Drop</a></div><aclass="sidebar-title"href="#synthetic-implementations">Auto Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-RefUnwindSafe">!RefUnwindSafe</a><ahref="#impl-Send">!Send</a><ahref="#impl-Sync">!Sync</a><ahref="#impl-Unpin">Unpin</a><ahref="#impl-UnwindSafe">!UnwindSafe</a></div><aclass="sidebar-title"href="#blanket-implementations">Blanket Implementations</a><divclass="sidebar-links"><ahref="#impl-Any">Any</a><ahref="#impl-Borrow%3CT%3E">Borrow<T></a><ahref="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><ahref="#impl-From%3CT%3E">From<T></a><ahref="#impl-Into%3CU%3E">Into<U></a><ahref="#impl-TryFrom%3CU%3E">TryFrom<U></a><ahref="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><pclass='location'><ahref='index.html'>crossbeam_epoch</a></p><script>window.sidebarCurrent={name:'Guard',ty:'struct',relpath:''};</script><scriptdefersrc="sidebar-items.js"></script></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"><imgsrc="../brush.svg"width="18"alt="Pick another theme!"></button><divid="theme-choices"></div></div><scriptsrc="../theme.js"></script><navclass="sub"><formclass="search-form js-only"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"></div><aid="settings-menu"href="../settings.html"><imgsrc="../wheel.svg"width="18"alt="Change settings"></a></div></form></nav><sectionid="main"class="content"><h1class='fqn'><spanclass='out-of-band'><spanid='render-detail'><aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass='inner'>−</span>]</a></span><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#68-70'title='goto source code'>[src]</a></span><spanclass='in-band'>Struct <ahref='index.html'>crossbeam_epoch</a>::<wbr><aclass="struct"href=''>Guard</a></span></h1><divclass="docblock type-decl hidden-by-usual-hider"><preclass='rust struct'>pub struct Guard { /* fields om
</div><h2id='methods'class='small-section-header'>Methods<ahref='#methods'class='anchor'></a></h2><h3id='impl'class='impl'><codeclass='in-band'>impl <aclass="struct"href="../crossbeam_epoch/struct.Guard.html"title="struct crossbeam_epoch::Guard">Guard</a></code><ahref='#impl'class='anchor'></a><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#72-415'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.defer'class="method"><codeid='defer.v'>pub fn <ahref='#method.defer'class='fnname'>defer</a><F, R>(&self, f: F) <spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>() -> R,<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> + 'static, </span></code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#90-98'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Stores a function so that it can be executed at some point after all currently pinned
threads get unpinned.</p>
<p>This method first stores <code>f</code> into the thread-local (or handle-local) cache. If this cache
becomes full, some functions are moved into the global cache. At the same time, some
functions from both local and global caches may get executed in order to incrementally
clean up the caches as they fill up.</p>
<p>There is no guarantee when exactly <code>f</code> will be executed. The only guarantee is that it
won't be executed until all currently pinned threads get unpinned. In theory, <code>f</code> might
never run, but the epoch-based garbage collection will make an effort to execute it
reasonably soon.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, the function will simply be
executed immediately.</p>
</div><h4id='method.defer_unchecked'class="method"><codeid='defer_unchecked.v'>pub unsafe fn <ahref='#method.defer_unchecked'class='fnname'>defer_unchecked</a><F, R>(&self, f: F) <spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>() -> R, </span></code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#190-197'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Stores a function so that it can be executed at some point after all currently pinned
threads get unpinned.</p>
<p>This method first stores <code>f</code> into the thread-local (or handle-local) cache. If this cache
becomes full, some functions are moved into the global cache. At the same time, some
functions from both local and global caches may get executed in order to incrementally
clean up the caches as they fill up.</p>
<p>There is no guarantee when exactly <code>f</code> will be executed. The only guarantee is that it
won't be executed until all currently pinned threads get unpinned. In theory, <code>f</code> might
never run, but the epoch-based garbage collection will make an effort to execute it
reasonably soon.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, the function will simply be
<p>Apart from that, keep in mind that another thread may execute <code>f</code>, so anything accessed by
the closure must be <code>Send</code>.</p>
<p>We intentionally didn't require <code>F: Send</code>, because Rust's type systems usually cannot prove
<code>F: Send</code> for typical use cases. For example, consider the following code snippet, which
exemplifies the typical use case of deferring the deallocation of a shared reference:</p>
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
<spanclass="ident">guard</span>.<spanclass="ident">defer_unchecked</span>(<spanclass="kw">move</span><spanclass="op">|</span><spanclass="op">|</span><spanclass="ident">shared</span>.<spanclass="ident">into_owned</span>()); <spanclass="comment">// `Shared` is not `Send`!</span></pre></div>
<p>While <code>Shared</code> is not <code>Send</code>, it's safe for another thread to call the deferred function,
because it's called only after the grace period and <code>shared</code> is no longer shared with other
threads. But we don't expect type systems to prove this.</p>
<spanclass="macro">println</span><spanclass="macro">!</span>(<spanclass="string">"{} is now being deallocated."</span>, <spanclass="ident">p</span>.<spanclass="ident">deref</span>());
<spanclass="comment">// Now we have unique access to the object pointed to by `p` and can turn it</span>
<spanclass="comment">// into an `Owned`. Dropping the `Owned` will deallocate the object.</span>
</div><h4id='method.defer_destroy'class="method"><codeid='defer_destroy.v'>pub unsafe fn <ahref='#method.defer_destroy'class='fnname'>defer_destroy</a><T>(&self, ptr: <aclass="struct"href="../crossbeam_epoch/struct.Shared.html"title="struct crossbeam_epoch::Shared">Shared</a><T>)</code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#269-271'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Stores a destructor for an object so that it can be deallocated and dropped at some point
after all currently pinned threads get unpinned.</p>
<p>This method first stores the destructor into the thread-local (or handle-local) cache. If
this cache becomes full, some destructors are moved into the global cache. At the same
time, some destructors from both local and global caches may get executed in order to
incrementally clean up the caches as they fill up.</p>
<p>There is no guarantee when exactly the destructor will be executed. The only guarantee is
that it won't be executed until all currently pinned threads get unpinned. In theory, the
destructor might never run, but the epoch-based garbage collection will make an effort to
execute it reasonably soon.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, the destructor will simply be
<p>The object must not be reachable by other threads anymore, otherwise it might be still in
use when the destructor runs.</p>
<p>Apart from that, keep in mind that another thread may execute the destructor, so the object
must be sendable to other threads.</p>
<p>We intentionally didn't require <code>T: Send</code>, because Rust's type systems usually cannot prove
<code>T: Send</code> for typical use cases. For example, consider the following code snippet, which
exemplifies the typical use case of deferring the deallocation of a shared reference:</p>
<divclass='information'><divclass='tooltip ignore'>ⓘ<spanclass='tooltiptext'>This example is not tested</span></div></div><divclass="example-wrap"><preclass="rust rust-example-rendered ignore">
<spanclass="ident">guard</span>.<spanclass="ident">defer_destroy</span>(<spanclass="ident">shared</span>); <spanclass="comment">// `Shared` is not `Send`!</span></pre></div>
<p>While <code>Shared</code> is not <code>Send</code>, it's safe for another thread to call the destructor, because
it's called only after the grace period and <code>shared</code> is no longer shared with other
threads. But we don't expect type systems to prove this.</p>
</div><h4id='method.flush'class="method"><codeid='flush.v'>pub fn <ahref='#method.flush'class='fnname'>flush</a>(&self)</code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#297-301'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Clears up the thread-local cache of deferred functions by executing them or moving into the
global cache.</p>
<p>Call this method after deferring execution of a function if you want to get it executed as
soon as possible. Flushing will make sure it is residing in in the global cache, so that
any thread has a chance of taking the function and executing it.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, it is a no-op (nothing happens).</p>
</div><h4id='method.repin'class="method"><codeid='repin.v'>pub fn <ahref='#method.repin'class='fnname'>repin</a>(&mut self)</code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#334-338'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Unpins and then immediately re-pins the thread.</p>
<p>This method is useful when you don't want delay the advancement of the global epoch by
holding an old epoch. For safety, you should not maintain any guard-based reference across
the call (the latter is enforced by <code>&mut self</code>). The thread will only be repinned if this
is the only active guard for the current thread.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, then the call will be just no-op.</p>
</div><h4id='method.repin_after'class="method"><codeid='repin_after.v'>pub fn <ahref='#method.repin_after'class='fnname'>repin_after</a><F, R>(&mut self, f: F) -> R <spanclass="where fmt-newline">where<br> F: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>() -> R, </span></code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#372-392'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Temporarily unpins the thread, executes the given function and then re-pins the thread.</p>
<p>This method is useful when you need to perform a long-running operation (e.g. sleeping)
and don't need to maintain any guard-based reference across the call (the latter is enforced
by <code>&mut self</code>). The thread will only be unpinned if this is the only active guard for the
current thread.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, then the passed function is called
</div><h4id='method.collector'class="method"><codeid='collector.v'>pub fn <ahref='#method.collector'class='fnname'>collector</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="struct"href="../crossbeam_epoch/struct.Collector.html"title="struct crossbeam_epoch::Collector">Collector</a>></code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#412-414'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Returns the <code>Collector</code> associated with this guard.</p>
<p>This method is useful when you need to ensure that all guards used with
a data structure come from the same collector.</p>
<p>If this method is called from an <ahref="fn.unprotected.html"><code>unprotected</code></a> guard, then <code>None</code> is returned.</p>
</div></div><h2id='implementations'class='small-section-header'>Trait Implementations<ahref='#implementations'class='anchor'></a></h2><divid='implementations-list'><h3id='impl-Drop'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html"title="trait core::ops::drop::Drop">Drop</a> for <aclass="struct"href="../crossbeam_epoch/struct.Guard.html"title="struct crossbeam_epoch::Guard">Guard</a></code><ahref='#impl-Drop'class='anchor'></a><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#417-424'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.drop'class="method hidden"><codeid='drop.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop'class='fnname'>drop</a>(&mut self)</code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#419-423'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Executes the destructor for this type. <ahref="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop">Read more</a></p>
</div></div><h3id='impl-Debug'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="../crossbeam_epoch/struct.Guard.html"title="struct crossbeam_epoch::Guard">Guard</a></code><ahref='#impl-Debug'class='anchor'></a><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#426-430'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.fmt'class="method hidden"><codeid='fmt.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt'class='fnname'>fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a>) -><aclass="type"href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></code><aclass='srclink'href='../src/crossbeam_epoch/guard.rs.html#427-429'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></div><h3id='impl-From%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</code><ahref='#impl-From%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#552-554'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.from'class="method hidden"><codeid='from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from'class='fnname'>from</a>(t: T) -> T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#553'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-TryFrom%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref='#impl-TryFrom%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error'class="type"><codeid='Error.t'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error'class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_from'class="method hidden"><codeid='try_from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from'class='fnname'>try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-TryInto%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref='#impl-TryInto%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error-1'class="type"><codeid='Error.t-1'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error'class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_into'class="method hidden"><codeid='try_into.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into'class='fnname'>try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-BorrowMut%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-BorrowMut%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow_mut'class="method hidden"><codeid='borrow_mut.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut'class='fnname'>borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3id='impl-Borrow%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Borrow%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow'class="method hidden"><codeid='borrow.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow'class='fnname'>borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3id='impl-Any'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br> T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Any'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.type_id'class="method hidden"><codeid='type_id.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id'class='fnname'>type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div></div></section><sectionid="search"class="content hidden"></section><sectionclass="footer"></section><asideid="help"class="hidden"><div><h1class="hidden">Help</h1><divclass="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><divclass="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath="../";window.currentCrate="crossbeam_epoch";</script><scriptsrc="../aliases.js"></script><scriptsrc="../main.js"></script><scriptdefersrc="../search-index.js"></script></body></html>