Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0c2243f8a1696816431e7210e991fa52 > files > 16093

rust-doc-1.35.0-1.mga7.armv7hl.rpm

<!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="API documentation for the Rust `DispatchFromDyn` trait in crate `std`."><meta name="keywords" content="rust, rustlang, rust-lang, DispatchFromDyn"><title>std::ops::DispatchFromDyn - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize1.35.0.css"><link rel="stylesheet" type="text/css" href="../../rustdoc1.35.0.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark1.35.0.css"><link rel="stylesheet" type="text/css" href="../../light1.35.0.css" id="themeStyle"><script src="../../storage1.35.0.js"></script><noscript><link rel="stylesheet" href="../../noscript1.35.0.css"></noscript><link rel="shortcut icon" href="../../favicon1.35.0.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow1.35.0.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../std/index.html'><img src='../../rust-logo1.35.0.png' alt='logo' width='100'></a><p class='location'>Trait DispatchFromDyn</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>ops</a></p><script>window.sidebarCurrent = {name: 'DispatchFromDyn', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush1.35.0.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme1.35.0.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel1.35.0.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span class='since' title='Stable since Rust version '></span><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/core/ops/unsize.rs.html#87-89' title='goto source code'>[src]</a></span><span class='in-band'>Trait <a href='../index.html'>std</a>::<wbr><a href='index.html'>ops</a>::<wbr><a class="trait" href=''>DispatchFromDyn</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'><div class="docblock attributes">#[lang = "dispatch_from_dyn"]
</div>pub trait DispatchFromDyn&lt;T&gt; { }</pre></div><div class='stability'><div class='stab unstable'><span class='emoji'>🔬</span> This is a nightly-only experimental API. (<code>dispatch_from_dyn</code>&nbsp;<a href="https://github.com/rust-lang/rust/issues/0">#0</a>)</div></div><div class='docblock'><p>This is used for object safety, to check that a method's receiver type can be dispatched on.</p>
<p>example impl:</p>

<div class="example-wrap"><pre class="rust rust-example-rendered">
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">T</span>: <span class="question-mark">?</span><span class="ident">Sized</span>, <span class="ident">U</span>: <span class="question-mark">?</span><span class="ident">Sized</span><span class="op">&gt;</span> <span class="ident">DispatchFromDyn</span><span class="op">&lt;</span><span class="ident">Rc</span><span class="op">&lt;</span><span class="ident">U</span><span class="op">&gt;&gt;</span> <span class="kw">for</span> <span class="ident">Rc</span><span class="op">&lt;</span><span class="ident">T</span><span class="op">&gt;</span>
<span class="kw">where</span>
    <span class="ident">T</span>: <span class="ident">Unsize</span><span class="op">&lt;</span><span class="ident">U</span><span class="op">&gt;</span>,
{}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(dispatch_from_dyn%2C%20unsize)%5D%0Afn%20main()%20%7B%0Ause%20std%3A%3A%7Bops%3A%3ADispatchFromDyn%2C%20marker%3A%3AUnsize%7D%3B%0Astruct%20Rc%3CT%3A%20%3FSized%3E(%3A%3Astd%3A%3Arc%3A%3ARc%3CT%3E)%3B%0Aimpl%3CT%3A%20%3FSized%2C%20U%3A%20%3FSized%3E%20DispatchFromDyn%3CRc%3CU%3E%3E%20for%20Rc%3CT%3E%0Awhere%0A%20%20%20%20T%3A%20Unsize%3CU%3E%2C%0A%7B%7D%0A%7D&amp;version=nightly">Run</a></pre></div>
</div>
            <h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'><h3 id='impl-DispatchFromDyn%3CPin%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;'a, P, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/pin/struct.Pin.html" title="struct std::pin::Pin">Pin</a>&lt;U&gt;&gt; for <a class="struct" href="../../std/pin/struct.Pin.html" title="struct std::pin::Pin">Pin</a>&lt;P&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="../../std/ops/trait.DispatchFromDyn.html" title="trait std::ops::DispatchFromDyn">DispatchFromDyn</a>&lt;U&gt;,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CPin%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/core/pin.rs.html#632-635' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3C%26%27a%20U%3E' class='impl'><code class='in-band'>impl&lt;'a, T, U&gt; DispatchFromDyn&lt;<a class="primitive" href="../primitive.reference.html">&amp;'a </a>U&gt; for <a class="primitive" href="../primitive.reference.html">&amp;'a </a>T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3C%26%27a%20U%3E' class='anchor'></a><a class='srclink' href='../../src/core/ops/unsize.rs.html#93' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3C%26%27a%20mut%20U%3E' class='impl'><code class='in-band'>impl&lt;'a, T, U&gt; DispatchFromDyn&lt;<a class="primitive" href="../primitive.reference.html">&amp;'a mut </a>U&gt; for <a class="primitive" href="../primitive.reference.html">&amp;'a mut </a>T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3C%26%27a%20mut%20U%3E' class='anchor'></a><a class='srclink' href='../../src/core/ops/unsize.rs.html#96' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3C*const%20U%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="primitive" href="../primitive.pointer.html">*const U</a>&gt; for <a class="primitive" href="../primitive.pointer.html">*const T</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3C*const%20U%3E' class='anchor'></a><a class='srclink' href='../../src/core/ops/unsize.rs.html#99' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3C*mut%20U%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="primitive" href="../primitive.pointer.html">*mut U</a>&gt; for <a class="primitive" href="../primitive.pointer.html">*mut T</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3C*mut%20U%3E' class='anchor'></a><a class='srclink' href='../../src/core/ops/unsize.rs.html#102' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CBox%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;U&gt;&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CBox%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/alloc/boxed.rs.html#778' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CNonNull%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;U&gt;&gt; for <a class="struct" href="../../std/ptr/struct.NonNull.html" title="struct std::ptr::NonNull">NonNull</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CNonNull%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/core/ptr.rs.html#3048' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CRc%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/rc/struct.Rc.html" title="struct std::rc::Rc">Rc</a>&lt;U&gt;&gt; for <a class="struct" href="../../std/rc/struct.Rc.html" title="struct std::rc::Rc">Rc</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CRc%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/alloc/rc.rs.html#287' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CWeak%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/rc/struct.Weak.html" title="struct std::rc::Weak">Weak</a>&lt;U&gt;&gt; for std::rc::<a class="struct" href="../../std/rc/struct.Weak.html" title="struct std::rc::Weak">Weak</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CWeak%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/alloc/rc.rs.html#1237' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CArc%3CU%3E%3E' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/sync/struct.Arc.html" title="struct std::sync::Arc">Arc</a>&lt;U&gt;&gt; for <a class="struct" href="../../std/sync/struct.Arc.html" title="struct std::sync::Arc">Arc</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CArc%3CU%3E%3E' class='anchor'></a><a class='srclink' href='../../src/alloc/sync.rs.html#207' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-DispatchFromDyn%3CWeak%3CU%3E%3E-1' class='impl'><code class='in-band'>impl&lt;T, U&gt; DispatchFromDyn&lt;<a class="struct" href="../../std/sync/struct.Weak.html" title="struct std::sync::Weak">Weak</a>&lt;U&gt;&gt; for std::sync::<a class="struct" href="../../std/sync/struct.Weak.html" title="struct std::sync::Weak">Weak</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Unsize.html" title="trait std::marker::Unsize">Unsize</a>&lt;U&gt; + ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;U: ?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a>,&nbsp;</span></code><a href='#impl-DispatchFromDyn%3CWeak%3CU%3E%3E-1' class='anchor'></a><a class='srclink' href='../../src/alloc/sync.rs.html#250' title='goto source code'>[src]</a></h3><div class='impl-items'></div></div><span class='loading-content'>Loading content...</span><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
                         src="../../implementors/core/ops/unsize/trait.DispatchFromDyn.js">
                 </script></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="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>&#9166;</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><div class="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 = "std";</script><script src="../../aliases.js"></script><script src="../../main1.35.0.js"></script><script defer src="../../search-index.js"></script></body></html>