mirror of
https://github.com/actix/actix-website
synced 2025-06-30 08:44:27 +02:00
update stable docs
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=struct.ChunkedReadFile.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="struct.ChunkedReadFile.html">struct.ChunkedReadFile.html</a>...</p>
|
||||
<script>location.replace("struct.ChunkedReadFile.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
10
static/api/actix-web/0.7.2/actix_web/fs/DefaultConfig.t.html
Normal file
10
static/api/actix-web/0.7.2/actix_web/fs/DefaultConfig.t.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=struct.DefaultConfig.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="struct.DefaultConfig.html">struct.DefaultConfig.html</a>...</p>
|
||||
<script>location.replace("struct.DefaultConfig.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
10
static/api/actix-web/0.7.2/actix_web/fs/Directory.t.html
Normal file
10
static/api/actix-web/0.7.2/actix_web/fs/Directory.t.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=struct.Directory.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="struct.Directory.html">struct.Directory.html</a>...</p>
|
||||
<script>location.replace("struct.Directory.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
10
static/api/actix-web/0.7.2/actix_web/fs/NamedFile.t.html
Normal file
10
static/api/actix-web/0.7.2/actix_web/fs/NamedFile.t.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=struct.NamedFile.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="struct.NamedFile.html">struct.NamedFile.html</a>...</p>
|
||||
<script>location.replace("struct.NamedFile.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=trait.StaticFileConfig.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="trait.StaticFileConfig.html">trait.StaticFileConfig.html</a>...</p>
|
||||
<script>location.replace("trait.StaticFileConfig.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
10
static/api/actix-web/0.7.2/actix_web/fs/StaticFiles.t.html
Normal file
10
static/api/actix-web/0.7.2/actix_web/fs/StaticFiles.t.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=struct.StaticFiles.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="struct.StaticFiles.html">struct.StaticFiles.html</a>...</p>
|
||||
<script>location.replace("struct.StaticFiles.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=fn.file_extension_to_mime.html">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="fn.file_extension_to_mime.html">fn.file_extension_to_mime.html</a>...</p>
|
||||
<script>location.replace("fn.file_extension_to_mime.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,4 @@
|
||||
<!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 `file_extension_to_mime` fn in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, file_extension_to_mime"><title>actix_web::fs::file_extension_to_mime - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc fn"><!--[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">☰</div><div class="sidebar-elems"><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'file_extension_to_mime', ty: 'fn', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="fn" href=''>file_extension_to_mime</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#103-105' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn file_extension_to_mime(ext: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <a class="struct" href="https://docs.rs/mime/0.3.8/mime/struct.Mime.html" title="struct mime::Mime">Mime</a></pre><div class='docblock'><p>Return the MIME type associated with a filename extension (case-insensitive).
|
||||
If <code>ext</code> is empty or no associated type for the extension was found, returns
|
||||
the type <code>application/octet-stream</code>.</p>
|
||||
</div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
65
static/api/actix-web/0.7.2/actix_web/fs/index.html
Normal file
65
static/api/actix-web/0.7.2/actix_web/fs/index.html
Normal file
@ -0,0 +1,65 @@
|
||||
<!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 `fs` mod in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, fs"><title>actix_web::fs - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc mod"><!--[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">☰</div><p class='location'>Module fs</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>actix_web</a></p><script>window.sidebarCurrent = {name: 'fs', ty: 'mod', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>actix_web</a>::<wbr><a class="mod" href=''>fs</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#1-1798' title='goto source code'>[src]</a></span></h1><div class='docblock'><p>Static files support</p>
|
||||
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||||
<table>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="struct" href="struct.ChunkedReadFile.html"
|
||||
title='struct actix_web::fs::ChunkedReadFile'>ChunkedReadFile</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>A helper created from a <code>std::fs::File</code> which reads the file
|
||||
chunk-by-chunk on a <code>CpuPool</code>.</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="struct" href="struct.DefaultConfig.html"
|
||||
title='struct actix_web::fs::DefaultConfig'>DefaultConfig</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>Default content disposition as described in
|
||||
<a href="trait.StaticFileConfig.html">StaticFileConfig</a></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="struct" href="struct.Directory.html"
|
||||
title='struct actix_web::fs::Directory'>Directory</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>A directory; responds with the generated directory listing.</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="struct" href="struct.NamedFile.html"
|
||||
title='struct actix_web::fs::NamedFile'>NamedFile</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>A file with an associated name.</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="struct" href="struct.StaticFiles.html"
|
||||
title='struct actix_web::fs::StaticFiles'>StaticFiles</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>Static files handling</p>
|
||||
|
||||
</td>
|
||||
</tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
||||
<table>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="trait" href="trait.StaticFileConfig.html"
|
||||
title='trait actix_web::fs::StaticFileConfig'>StaticFileConfig</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>Describes <code>StaticFiles</code> configiration</p>
|
||||
|
||||
</td>
|
||||
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||||
<table>
|
||||
<tr class=' module-item'>
|
||||
<td><a class="fn" href="fn.file_extension_to_mime.html"
|
||||
title='fn actix_web::fs::file_extension_to_mime'>file_extension_to_mime</a></td>
|
||||
<td class='docblock-short'>
|
||||
<p>Return the MIME type associated with a filename extension (case-insensitive).
|
||||
If <code>ext</code> is empty or no associated type for the extension was found, returns
|
||||
the type <code>application/octet-stream</code>.</p>
|
||||
|
||||
</td>
|
||||
</tr></table></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
1
static/api/actix-web/0.7.2/actix_web/fs/sidebar-items.js
Normal file
1
static/api/actix-web/0.7.2/actix_web/fs/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"fn":[["file_extension_to_mime","Return the MIME type associated with a filename extension (case-insensitive). If `ext` is empty or no associated type for the extension was found, returns the type `application/octet-stream`."]],"struct":[["ChunkedReadFile","A helper created from a `std::fs::File` which reads the file chunk-by-chunk on a `CpuPool`."],["DefaultConfig","Default content disposition as described in StaticFileConfig"],["Directory","A directory; responds with the generated directory listing."],["NamedFile","A file with an associated name."],["StaticFiles","Static files handling"]],"trait":[["StaticFileConfig","Describes `StaticFiles` configiration"]]});
|
@ -0,0 +1,54 @@
|
||||
<!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 `ChunkedReadFile` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, ChunkedReadFile"><title>actix_web::fs::ChunkedReadFile - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc struct"><!--[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">☰</div><p class='location'>Struct ChunkedReadFile</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Stream">Stream</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'ChunkedReadFile', ty: 'struct', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>ChunkedReadFile</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#485-492' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct ChunkedReadFile { /* fields omitted */ }</pre></div><div class='docblock'><p>A helper created from a <code>std::fs::File</code> which reads the file
|
||||
chunk-by-chunk on a <code>CpuPool</code>.</p>
|
||||
</div>
|
||||
<h2 id='implementations' class='small-section-header'>
|
||||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='implementations-list'><h3 id='impl-Stream' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a> for <a class="struct" href="../../actix_web/fs/struct.ChunkedReadFile.html" title="struct actix_web::fs::ChunkedReadFile">ChunkedReadFile</a></code><a href='#impl-Stream' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#494-534' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><span id='Item.t' class='invisible'><code>type <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item' class="type">Item</a> = <a class="struct" href="https://docs.rs/bytes/0.4.9/bytes/bytes/struct.Bytes.html" title="struct bytes::bytes::Bytes">Bytes</a></code></span></h4>
|
||||
<div class='docblock'><p>The type of item this stream will yield on success.</p>
|
||||
</div><h4 id='associatedtype.Error' class="type"><span id='Error.t' class='invisible'><code>type <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a></code></span></h4>
|
||||
<div class='docblock'><p>The type of error this stream may generate.</p>
|
||||
</div><h4 id='method.poll' class="method"><span id='poll.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#tymethod.poll' class='fnname'>poll</a>(&mut self) -> <a class="type" href="https://docs.rs/futures/0.1/futures/poll/type.Poll.html" title="type futures::poll::Poll">Poll</a><<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://docs.rs/bytes/0.4.9/bytes/bytes/struct.Bytes.html" title="struct bytes::bytes::Bytes">Bytes</a>>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#498-533' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempt to pull out the next value of this stream, returning <code>None</code> if the stream is finished. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#tymethod.poll">Read more</a></p>
|
||||
</div><h4 id='method.wait' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/wait/struct.Wait.html" title="struct futures::stream::wait::Wait">Wait</a><S></span></div><div class="content hidden"><h3 class="important">Important traits for <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/wait/struct.Wait.html" title="struct futures::stream::wait::Wait">Wait</a><S></h3><code class="content"><span class="where fmt-newline">impl<S> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/wait/struct.Wait.html" title="struct futures::stream::wait::Wait">Wait</a><S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<S as <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, <S as <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>;</span></code></div></div><span id='wait.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.wait' class='fnname'>wait</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/wait/struct.Wait.html" title="struct futures::stream::wait::Wait">Wait</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#244-248' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator which blocks the current thread until each item of this stream is resolved. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.wait">Read more</a></p>
|
||||
</div><h4 id='method.into_future' class="method"><span id='into_future.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.into_future' class='fnname'>into_future</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/future/struct.StreamFuture.html" title="struct futures::stream::future::StreamFuture">StreamFuture</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#291-295' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts this stream into a <code>Future</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.into_future">Read more</a></p>
|
||||
</div><h4 id='method.map' class="method"><span id='map.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.map' class='fnname'>map</a><U, F>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/map/struct.Map.html" title="struct futures::stream::map::Map">Map</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> U, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#316-321' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts a stream of type <code>T</code> to a stream of type <code>U</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.map">Read more</a></p>
|
||||
</div><h4 id='method.map_err' class="method"><span id='map_err.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.map_err' class='fnname'>map_err</a><U, F>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/map_err/struct.MapErr.html" title="struct futures::stream::map_err::MapErr">MapErr</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>) -> U, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#342-347' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Converts a stream of error type <code>T</code> to a stream of error type <code>U</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.map_err">Read more</a></p>
|
||||
</div><h4 id='method.filter' class="method"><span id='filter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.filter' class='fnname'>filter</a><F>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/filter/struct.Filter.html" title="struct futures::stream::filter::Filter">Filter</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#372-377' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Filters the values produced by this stream according to the provided predicate. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.filter">Read more</a></p>
|
||||
</div><h4 id='method.filter_map' class="method"><span id='filter_map.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.filter_map' class='fnname'>filter_map</a><F, B>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/filter_map/struct.FilterMap.html" title="struct futures::stream::filter_map::FilterMap">FilterMap</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><B>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#408-413' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Filters the values produced by this stream while simultaneously mapping them to a different type. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.filter_map">Read more</a></p>
|
||||
</div><h4 id='method.then' class="method"><span id='then.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.then' class='fnname'>then</a><F, U>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/then/struct.Then.html" title="struct futures::stream::then::Then">Then</a><Self, F, U> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>) -> U,<br> U: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#447-453' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Chain on a computation for when a value is ready, passing the resulting item to the provided closure <code>f</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.then">Read more</a></p>
|
||||
</div><h4 id='method.and_then' class="method"><span id='and_then.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.and_then' class='fnname'>and_then</a><F, U>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/and_then/struct.AndThen.html" title="struct futures::stream::and_then::AndThen">AndThen</a><Self, F, U> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> U,<br> U: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#494-500' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Chain on a computation for when a value is ready, passing the successful results to the provided closure <code>f</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.and_then">Read more</a></p>
|
||||
</div><h4 id='method.or_else' class="method"><span id='or_else.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.or_else' class='fnname'>or_else</a><F, U>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/or_else/struct.OrElse.html" title="struct futures::stream::or_else::OrElse">OrElse</a><Self, F, U> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>) -> U,<br> U: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Item = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#521-527' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Chain on a computation for when an error happens, passing the erroneous result to the provided closure <code>f</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.or_else">Read more</a></p>
|
||||
</div><h4 id='method.collect' class="method"><span id='collect.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.collect' class='fnname'>collect</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/collect/struct.Collect.html" title="struct futures::stream::collect::Collect">Collect</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#562-566' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Collect all of the values of this stream into a vector, returning a future representing the result of that computation. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.collect">Read more</a></p>
|
||||
</div><h4 id='method.concat2' class="method"><span id='concat2.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.concat2' class='fnname'>concat2</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/concat/struct.Concat2.html" title="struct futures::stream::concat::Concat2">Concat2</a><Self> <span class="where fmt-newline">where<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a><<Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::IntoIterator::Item">Item</a>>,<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>,<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#598-603' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Concatenate all results of a stream into a single extendable destination, returning a future representing the end result. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.concat2">Read more</a></p>
|
||||
</div><h4 id='method.concat' class="method"><span id='concat.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.concat' class='fnname'>concat</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/concat/struct.Concat.html" title="struct futures::stream::concat::Concat">Concat</a><Self> <span class="where fmt-newline">where<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a><<Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::IntoIterator::Item">Item</a>>,<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#638-643' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.1.14<p>: please use <code>Stream::concat2</code> instead</p>
|
||||
</div></div><div class='docblock'><p>Concatenate all results of a stream into a single extendable destination, returning a future representing the end result. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.concat">Read more</a></p>
|
||||
</div><h4 id='method.fold' class="method"><span id='fold.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.fold' class='fnname'>fold</a><F, T, Fut>(self, init: T, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/fold/struct.Fold.html" title="struct futures::stream::fold::Fold">Fold</a><Self, F, Fut, T> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(T, Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> Fut,<br> Fut: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Item = T>,<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<Fut as <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#668-675' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Execute an accumulating computation over a stream, collecting all the values into one final result. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.fold">Read more</a></p>
|
||||
</div><h4 id='method.flatten' class="method"><span id='flatten.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.flatten' class='fnname'>flatten</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/flatten/struct.Flatten.html" title="struct futures::stream::flatten::Flatten">Flatten</a><Self> <span class="where fmt-newline">where<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>,<br> <Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#710-716' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Flattens a stream of streams into just one continuous stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.flatten">Read more</a></p>
|
||||
</div><h4 id='method.skip_while' class="method"><span id='skip_while.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.skip_while' class='fnname'>skip_while</a><P, R>(self, pred: P) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/skip_while/struct.SkipWhile.html" title="struct futures::stream::skip_while::SkipWhile">SkipWhile</a><Self, P, R> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#725-731' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Skip elements on this stream while the predicate provided resolves to <code>true</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.skip_while">Read more</a></p>
|
||||
</div><h4 id='method.take_while' class="method"><span id='take_while.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.take_while' class='fnname'>take_while</a><P, R>(self, pred: P) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/take_while/struct.TakeWhile.html" title="struct futures::stream::take_while::TakeWhile">TakeWhile</a><Self, P, R> <span class="where fmt-newline">where<br> P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> R,<br> R: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>, Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#739-745' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Take elements from this stream while the predicate provided resolves to <code>true</code>. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.take_while">Read more</a></p>
|
||||
</div><h4 id='method.for_each' class="method"><span id='for_each.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.for_each' class='fnname'>for_each</a><F, U>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/for_each/struct.ForEach.html" title="struct futures::stream::for_each::ForEach">ForEach</a><Self, F, U> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>) -> U,<br> U: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a><Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#761-767' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Runs this stream to completion, executing the provided closure for each element on the stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.for_each">Read more</a></p>
|
||||
</div><h4 id='method.from_err' class="method"><span id='from_err.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.from_err' class='fnname'>from_err</a><E>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/from_err/struct.FromErr.html" title="struct futures::stream::from_err::FromErr">FromErr</a><Self, E> <span class="where fmt-newline">where<br> E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#780-784' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Map this stream's error to any error implementing <code>From</code> for this stream's <code>Error</code>, returning a new stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.from_err">Read more</a></p>
|
||||
</div><h4 id='method.take' class="method"><span id='take.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.take' class='fnname'>take</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/take/struct.Take.html" title="struct futures::stream::take::Take">Take</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#796-800' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a new stream of at most <code>amt</code> items of the underlying stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.take">Read more</a></p>
|
||||
</div><h4 id='method.skip' class="method"><span id='skip.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.skip' class='fnname'>skip</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/skip/struct.Skip.html" title="struct futures::stream::skip::Skip">Skip</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#811-815' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a new stream which skips <code>amt</code> items of the underlying stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.skip">Read more</a></p>
|
||||
</div><h4 id='method.fuse' class="method"><span id='fuse.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.fuse' class='fnname'>fuse</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/fuse/struct.Fuse.html" title="struct futures::stream::fuse::Fuse">Fuse</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#832-836' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Fuse a stream such that <code>poll</code> will never again be called once it has finished. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.fuse">Read more</a></p>
|
||||
</div><h4 id='method.by_ref' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R</span></div><div class="content hidden"><h3 class="important">Important traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R</h3><code class="content"><span class="where fmt-newline">impl<'a, R> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'a, W> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>W <span class="where fmt-newline">where<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'a, I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'a mut </a>I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html" title="trait core::iter::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::iterator::Iterator::Item">Item</a>;</span></code></div></div><span id='by_ref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.by_ref' class='fnname'>by_ref</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#857-861' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a stream, rather than consuming it. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.by_ref">Read more</a></p>
|
||||
</div><h4 id='method.catch_unwind' class="method"><span id='catch_unwind.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.catch_unwind' class='fnname'>catch_unwind</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/catch_unwind/struct.CatchUnwind.html" title="struct futures::stream::catch_unwind::CatchUnwind">CatchUnwind</a><Self> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#897-901' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Catches unwinding panics while polling the stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.catch_unwind">Read more</a></p>
|
||||
</div><h4 id='method.buffered' class="method"><span id='buffered.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.buffered' class='fnname'>buffered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/buffered/struct.Buffered.html" title="struct futures::stream::buffered::Buffered">Buffered</a><Self> <span class="where fmt-newline">where<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br> <Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a> == Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#917-922' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>An adaptor for creating a buffered list of pending futures. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.buffered">Read more</a></p>
|
||||
</div><h4 id='method.buffer_unordered' class="method"><span id='buffer_unordered.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.buffer_unordered' class='fnname'>buffer_unordered</a>(self, amt: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/buffer_unordered/struct.BufferUnordered.html" title="struct futures::stream::buffer_unordered::BufferUnordered">BufferUnordered</a><Self> <span class="where fmt-newline">where<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>: <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>,<br> <Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a> as <a class="trait" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html" title="trait futures::future::IntoFuture">IntoFuture</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/future/trait.IntoFuture.html#associatedtype.Error" title="type futures::future::IntoFuture::Error">Error</a> == Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#938-943' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>An adaptor for creating a buffered list of pending futures (unordered). <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.buffer_unordered">Read more</a></p>
|
||||
</div><h4 id='method.merge' class="method"><span id='merge.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.merge' class='fnname'>merge</a><S>(self, other: S) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/merge/struct.Merge.html" title="struct futures::stream::merge::Merge">Merge</a><Self, S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#952-957' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated<p>: functionality provided by <code>select</code> now</p>
|
||||
</div></div><div class='docblock'><p>An adapter for merging the output of two streams. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.merge">Read more</a></p>
|
||||
</div><h4 id='method.zip' class="method"><span id='zip.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.zip' class='fnname'>zip</a><S>(self, other: S) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/zip/struct.Zip.html" title="struct futures::stream::zip::Zip">Zip</a><Self, S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#964-969' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>An adapter for zipping two streams together. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.zip">Read more</a></p>
|
||||
</div><h4 id='method.chain' class="method"><span id='chain.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.chain' class='fnname'>chain</a><S>(self, other: S) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/chain/struct.Chain.html" title="struct futures::stream::chain::Chain">Chain</a><Self, S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#990-995' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Adapter for chaining two stream. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.chain">Read more</a></p>
|
||||
</div><h4 id='method.peekable' class="method"><span id='peekable.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.peekable' class='fnname'>peekable</a>(self) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/peek/struct.Peekable.html" title="struct futures::stream::peek::Peekable">Peekable</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1000-1004' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a new stream which exposes a <code>peek</code> method. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.peekable">Read more</a></p>
|
||||
</div><h4 id='method.chunks' class="method"><span id='chunks.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.chunks' class='fnname'>chunks</a>(self, capacity: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/chunks/struct.Chunks.html" title="struct futures::stream::chunks::Chunks">Chunks</a><Self></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1027-1031' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>An adaptor for chunking up items of the stream inside a vector. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.chunks">Read more</a></p>
|
||||
</div><h4 id='method.select' class="method"><span id='select.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.select' class='fnname'>select</a><S>(self, other: S) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/select/struct.Select.html" title="struct futures::stream::select::Select">Select</a><Self, S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html" title="trait futures::stream::Stream">Stream</a><Item = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>, Error = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1044-1049' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates a stream that selects the next element from either this stream or the provided one, whichever is ready first. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.select">Read more</a></p>
|
||||
</div><h4 id='method.forward' class="method"><span id='forward.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.forward' class='fnname'>forward</a><S>(self, sink: S) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/forward/struct.Forward.html" title="struct futures::stream::forward::Forward">Forward</a><Self, S> <span class="where fmt-newline">where<br> S: <a class="trait" href="https://docs.rs/futures/0.1/futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a><SinkItem = Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>>,<br> Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<S as <a class="trait" href="https://docs.rs/futures/0.1/futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>>::<a class="type" href="https://docs.rs/futures/0.1/futures/sink/trait.Sink.html#associatedtype.SinkError" title="type futures::sink::Sink::SinkError">SinkError</a>>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1065-1071' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>A future that completes after the given stream has been fully processed into the sink, including flushing. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.forward">Read more</a></p>
|
||||
</div><h4 id='method.split' class="method"><span id='split.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.split' class='fnname'>split</a>(self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://docs.rs/futures/0.1/futures/stream/split/struct.SplitSink.html" title="struct futures::stream::split::SplitSink">SplitSink</a><Self>, <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/split/struct.SplitStream.html" title="struct futures::stream::split::SplitStream">SplitStream</a><Self><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br> Self: <a class="trait" href="https://docs.rs/futures/0.1/futures/sink/trait.Sink.html" title="trait futures::sink::Sink">Sink</a>, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1083-1087' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Splits this <code>Stream + Sink</code> object into separate <code>Stream</code> and <code>Sink</code> objects. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.split">Read more</a></p>
|
||||
</div><h4 id='method.inspect' class="method"><span id='inspect.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.inspect' class='fnname'>inspect</a><F>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/inspect/struct.Inspect.html" title="struct futures::stream::inspect::Inspect">Inspect</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Item" title="type futures::stream::Stream::Item">Item</a>), </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1094-1099' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Do something with each item of this stream, afterwards passing it on. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.inspect">Read more</a></p>
|
||||
</div><h4 id='method.inspect_err' class="method"><span id='inspect_err.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.inspect_err' class='fnname'>inspect_err</a><F>(self, f: F) -> <a class="struct" href="https://docs.rs/futures/0.1/futures/stream/inspect_err/struct.InspectErr.html" title="struct futures::stream::inspect_err::InspectErr">InspectErr</a><Self, F> <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&Self::<a class="type" href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#associatedtype.Error" title="type futures::stream::Stream::Error">Error</a>), </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='https://docs.rs/futures/0.1/src/futures/stream/mod.rs.html#1106-1111' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Do something with the error of this stream, afterwards passing it on. <a href="https://docs.rs/futures/0.1/futures/stream/trait.Stream.html#method.inspect_err">Read more</a></p>
|
||||
</div></div></div>
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='synthetic-implementations-list'>
|
||||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/fs/struct.ChunkedReadFile.html" title="struct actix_web::fs::ChunkedReadFile">ChunkedReadFile</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/fs/struct.ChunkedReadFile.html" title="struct actix_web::fs::ChunkedReadFile">ChunkedReadFile</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -0,0 +1,17 @@
|
||||
<!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 `DefaultConfig` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, DefaultConfig"><title>actix_web::fs::DefaultConfig - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc struct"><!--[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">☰</div><p class='location'>Struct DefaultConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Default">Default</a><a href="#impl-StaticFileConfig">StaticFileConfig</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'DefaultConfig', ty: 'struct', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>DefaultConfig</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#96' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct DefaultConfig;</pre></div><div class='docblock'><p>Default content disposition as described in
|
||||
<a href="trait.StaticFileConfig.html">StaticFileConfig</a></p>
|
||||
</div>
|
||||
<h2 id='implementations' class='small-section-header'>
|
||||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='implementations-list'><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#95' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#95' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
||||
</div></div><h3 id='impl-StaticFileConfig' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="../../actix_web/fs/trait.StaticFileConfig.html" title="trait actix_web::fs::StaticFileConfig">StaticFileConfig</a> for <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code><a href='#impl-StaticFileConfig' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#97' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.content_disposition_map' class="method"><span id='content_disposition_map.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/fs/trait.StaticFileConfig.html#method.content_disposition_map' class='fnname'>content_disposition_map</a>(typ: <a class="struct" href="https://docs.rs/mime/0.3.8/mime/struct.Name.html" title="struct mime::Name">Name</a>) -> <a class="enum" href="../../actix_web/http/header/enum.DispositionType.html" title="enum actix_web::http::header::DispositionType">DispositionType</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#64-69' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Describes mapping for mime type to content disposition header <a href="../../actix_web/fs/trait.StaticFileConfig.html#method.content_disposition_map">Read more</a></p>
|
||||
</div><h4 id='method.is_use_etag' class="method"><span id='is_use_etag.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/fs/trait.StaticFileConfig.html#method.is_use_etag' class='fnname'>is_use_etag</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#74-76' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Describes whether Actix should attempt to calculate <code>ETag</code> <a href="../../actix_web/fs/trait.StaticFileConfig.html#method.is_use_etag">Read more</a></p>
|
||||
</div><h4 id='method.is_use_last_modifier' class="method"><span id='is_use_last_modifier.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/fs/trait.StaticFileConfig.html#method.is_use_last_modifier' class='fnname'>is_use_last_modifier</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#81-83' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Describes whether Actix should use last modified date of file. <a href="../../actix_web/fs/trait.StaticFileConfig.html#method.is_use_last_modifier">Read more</a></p>
|
||||
</div><h4 id='method.is_method_allowed' class="method"><span id='is_method_allowed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/fs/trait.StaticFileConfig.html#method.is_method_allowed' class='fnname'>is_method_allowed</a>(_method: &<a class="struct" href="../../actix_web/http/struct.Method.html" title="struct actix_web::http::Method">Method</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#88-90' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Describes allowed methods to access static resources. <a href="../../actix_web/fs/trait.StaticFileConfig.html#method.is_method_allowed">Read more</a></p>
|
||||
</div></div></div>
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='synthetic-implementations-list'>
|
||||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -0,0 +1,32 @@
|
||||
<!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 `Directory` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, Directory"><title>actix_web::fs::Directory - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc struct"><!--[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">☰</div><p class='location'>Struct Directory</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.base">base</a><a href="#structfield.path">path</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.is_visible">is_visible</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'Directory', ty: 'struct', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>Directory</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#541-546' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct Directory {
|
||||
pub base: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>,
|
||||
pub path: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>,
|
||||
}</pre></div><div class='docblock'><p>A directory; responds with the generated directory listing.</p>
|
||||
</div><h2 id='fields' class='fields small-section-header'>
|
||||
Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.base" class="structfield small-section-header">
|
||||
<a href="#structfield.base" class="anchor field"></a>
|
||||
<span id="base.v" class='invisible'>
|
||||
<code>base: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code>
|
||||
</span></span><div class='docblock'><p>Base directory</p>
|
||||
</div><span id="structfield.path" class="structfield small-section-header">
|
||||
<a href="#structfield.path" class="anchor field"></a>
|
||||
<span id="path.v" class='invisible'>
|
||||
<code>path: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code>
|
||||
</span></span><div class='docblock'><p>Path of subdirectory to generate listing for</p>
|
||||
</div>
|
||||
<h2 id='methods' class='small-section-header'>
|
||||
Methods<a href='#methods' class='anchor'></a>
|
||||
</h2>
|
||||
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#548-569' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>(base: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>, path: <a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>) -> <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#550-552' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create a new directory</p>
|
||||
</div><h4 id='method.is_visible' class="method"><span id='is_visible.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.is_visible' class='fnname'>is_visible</a>(&self, entry: &<a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.DirEntry.html" title="struct std::fs::DirEntry">DirEntry</a>>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#555-568' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Is this entry visible from this directory?</p>
|
||||
</div></div>
|
||||
<h2 id='implementations' class='small-section-header'>
|
||||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='implementations-list'><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#540' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#540' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div></div>
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='synthetic-implementations-list'>
|
||||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
183
static/api/actix-web/0.7.2/actix_web/fs/struct.NamedFile.html
Normal file
183
static/api/actix-web/0.7.2/actix_web/fs/struct.NamedFile.html
Normal file
@ -0,0 +1,183 @@
|
||||
<!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 `NamedFile` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, NamedFile"><title>actix_web::fs::NamedFile - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc struct"><!--[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">☰</div><p class='location'>Struct NamedFile</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.open">open</a><a href="#method.open_with_config">open_with_config</a><a href="#method.file">file</a><a href="#method.path">path</a><a href="#method.set_cpu_pool">set_cpu_pool</a><a href="#method.set_status_code">set_status_code</a><a href="#method.set_content_type">set_content_type</a><a href="#method.set_content_disposition">set_content_disposition</a><a href="#method.set_content_encoding">set_content_encoding</a></div><a class="sidebar-title" href="#deref-methods">Methods from Deref<Target=File></a><div class="sidebar-links"><a href="#method.sync_all">sync_all</a><a href="#method.sync_data">sync_data</a><a href="#method.set_len">set_len</a><a href="#method.metadata">metadata</a><a href="#method.try_clone">try_clone</a><a href="#method.set_permissions">set_permissions</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Deref">Deref</a><a href="#impl-DerefMut">DerefMut</a><a href="#impl-Responder">Responder</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'NamedFile', ty: 'struct', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>NamedFile</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#109-120' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct NamedFile<C = <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>A file with an associated name.</p>
|
||||
</div>
|
||||
<h2 id='methods' class='small-section-header'>
|
||||
Methods<a href='#methods' class='anchor'></a>
|
||||
</h2>
|
||||
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#122-135' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.open' class="method"><span id='open.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.open' class='fnname'>open</a><P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(path: P) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#132-134' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to open a file in read-only mode.</p>
|
||||
<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">fs</span>::<span class="ident">NamedFile</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">NamedFile</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>);</pre>
|
||||
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C: <a class="trait" href="../../actix_web/fs/trait.StaticFileConfig.html" title="trait actix_web::fs::StaticFileConfig">StaticFileConfig</a>> <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C></code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#137-291' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.open_with_config' class="method"><span id='open_with_config.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.open_with_config' class='fnname'>open_with_config</a><P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>>>(path: P, _: C) -> <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#147-193' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to open a file in read-only mode using provided configiration.</p>
|
||||
<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">fs</span>::{<span class="ident">DefaultConfig</span>, <span class="ident">NamedFile</span>};
|
||||
|
||||
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">NamedFile</span>::<span class="ident">open_with_config</span>(<span class="string">"foo.txt"</span>, <span class="ident">DefaultConfig</span>);</pre>
|
||||
</div><h4 id='method.file' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></div><div class="content hidden"><h3 class="important">Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></h3><code class="content"><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></code></div></div><span id='file.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.file' class='fnname'>file</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#197-199' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns reference to the underlying <code>File</code> object.</p>
|
||||
</div><h4 id='method.path' class="method"><span id='path.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.path' class='fnname'>path</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#216-218' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Retrieve the path of this file.</p>
|
||||
<h1 id="examples-2" class="section-header"><a href="#examples-2">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">fs</span>::<span class="ident">NamedFile</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">NamedFile</span>::<span class="ident">open</span>(<span class="string">"test.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">file</span>.<span class="ident">path</span>().<span class="ident">as_os_str</span>(), <span class="string">"foo.txt"</span>);</pre>
|
||||
</div><h4 id='method.set_cpu_pool' class="method"><span id='set_cpu_pool.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_cpu_pool' class='fnname'>set_cpu_pool</a>(self, cpu_pool: CpuPool) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#222-225' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set <code>CpuPool</code> to use</p>
|
||||
</div><h4 id='method.set_status_code' class="method"><span id='set_status_code.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_status_code' class='fnname'>set_status_code</a>(self, status: <a class="struct" href="../../actix_web/http/struct.StatusCode.html" title="struct actix_web::http::StatusCode">StatusCode</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#228-231' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set response <strong>Status Code</strong></p>
|
||||
</div><h4 id='method.set_content_type' class="method"><span id='set_content_type.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_content_type' class='fnname'>set_content_type</a>(self, mime_type: <a class="struct" href="https://docs.rs/mime/0.3.8/mime/struct.Mime.html" title="struct mime::Mime">Mime</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#236-239' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set the MIME Content-Type for serving this file. By default
|
||||
the Content-Type is inferred from the filename extension.</p>
|
||||
</div><h4 id='method.set_content_disposition' class="method"><span id='set_content_disposition.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_content_disposition' class='fnname'>set_content_disposition</a>(self, cd: <a class="struct" href="../../actix_web/http/header/struct.ContentDisposition.html" title="struct actix_web::http::header::ContentDisposition">ContentDisposition</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#249-252' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set the Content-Disposition for serving this file. This allows
|
||||
changing the inline/attachment disposition as well as the filename
|
||||
sent to the peer. By default the disposition is <code>inline</code> for text,
|
||||
image, and video content types, and <code>attachment</code> otherwise, and
|
||||
the filename is taken from the path provided in the <code>open</code> method
|
||||
after converting it to UTF-8 using
|
||||
<a href="https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.to_string_lossy">to_string_lossy</a>.</p>
|
||||
</div><h4 id='method.set_content_encoding' class="method"><span id='set_content_encoding.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_content_encoding' class='fnname'>set_content_encoding</a>(self, enc: <a class="enum" href="../../actix_web/http/enum.ContentEncoding.html" title="enum actix_web::http::ContentEncoding">ContentEncoding</a>) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#256-259' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set content encoding for serving this file</p>
|
||||
</div></div>
|
||||
<h2 id='deref-methods' class='small-section-header'>
|
||||
Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a>><a href='#deref-methods' class='anchor'></a>
|
||||
</h2>
|
||||
<div class='impl-items'><h4 id='method.sync_all' class="method"><span id='sync_all.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.sync_all' class='fnname'>sync_all</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#412-414' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Attempts to sync all OS-internal metadata to disk.</p>
|
||||
<p>This function will attempt to ensure that all in-core data reaches the
|
||||
filesystem before returning.</p>
|
||||
<h1 id="examples-3" class="section-header"><a href="#examples-3">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">create</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="ident">f</span>.<span class="ident">write_all</span>(<span class="string">b"Hello, world!"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="ident">f</span>.<span class="ident">sync_all</span>()<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
</div><h4 id='method.sync_data' class="method"><span id='sync_data.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.sync_data' class='fnname'>sync_data</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#443-445' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This function is similar to <a href="struct.File.html#method.sync_all"><code>sync_all</code></a>, except that it may not
|
||||
synchronize file metadata to the filesystem.</p>
|
||||
<p>This is intended for use cases that must synchronize content, but don't
|
||||
need the metadata on disk. The goal of this method is to reduce disk
|
||||
operations.</p>
|
||||
<p>Note that some platforms may simply implement this in terms of
|
||||
<a href="struct.File.html#method.sync_all"><code>sync_all</code></a>.</p>
|
||||
<h1 id="examples-4" class="section-header"><a href="#examples-4">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">create</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="ident">f</span>.<span class="ident">write_all</span>(<span class="string">b"Hello, world!"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="ident">f</span>.<span class="ident">sync_data</span>()<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
</div><h4 id='method.set_len' class="method"><span id='set_len.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_len' class='fnname'>set_len</a>(&self, size: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#478-480' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Truncates or extends the underlying file, updating the size of
|
||||
this file to become <code>size</code>.</p>
|
||||
<p>If the <code>size</code> is less than the current file's size, then the file will
|
||||
be shrunk. If it is greater than the current file's size, then the file
|
||||
will be extended to <code>size</code> and have all of the intermediate data filled
|
||||
in with 0s.</p>
|
||||
<p>The file's cursor isn't changed. In particular, if the cursor was at the
|
||||
end and the file is shrunk using this operation, the cursor will now be
|
||||
past the end.</p>
|
||||
<h1 id="errors" class="section-header"><a href="#errors">Errors</a></h1>
|
||||
<p>This function will return an error if the file is not opened for writing.</p>
|
||||
<h1 id="examples-5" class="section-header"><a href="#examples-5">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">create</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="ident">f</span>.<span class="ident">set_len</span>(<span class="number">10</span>)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
<p>Note that this method alters the content of the underlying file, even
|
||||
though it takes <code>&self</code> rather than <code>&mut self</code>.</p>
|
||||
</div><h4 id='method.metadata' class="method"><span id='metadata.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.metadata' class='fnname'>metadata</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.Metadata.html" title="struct std::fs::Metadata">Metadata</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#496-498' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Queries metadata about the underlying file.</p>
|
||||
<h1 id="examples-6" class="section-header"><a href="#examples-6">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">f</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="ident">metadata</span> <span class="op">=</span> <span class="ident">f</span>.<span class="ident">metadata</span>()<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
</div><h4 id='method.try_clone' class="method"><span id='try_clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.try_clone' class='fnname'>try_clone</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.9.0'>1.9.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#540-544' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create a new <code>File</code> instance that shares the same underlying file handle
|
||||
as the existing <code>File</code> instance. Reads, writes, and seeks will affect
|
||||
both <code>File</code> instances simultaneously.</p>
|
||||
<h1 id="examples-7" class="section-header"><a href="#examples-7">Examples</a></h1>
|
||||
<p>Create two handles for a file named <code>foo.txt</code>:</p>
|
||||
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="ident">file_copy</span> <span class="op">=</span> <span class="ident">file</span>.<span class="ident">try_clone</span>()<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
<p>Assuming there’s a file named <code>foo.txt</code> with contents <code>abcdef\n</code>, create
|
||||
two handles, seek one of them, and read the remaining bytes from the
|
||||
other handle:</p>
|
||||
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">SeekFrom</span>;
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="ident">prelude</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file_copy</span> <span class="op">=</span> <span class="ident">file</span>.<span class="ident">try_clone</span>()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="ident">file</span>.<span class="ident">seek</span>(<span class="ident">SeekFrom</span>::<span class="ident">Start</span>(<span class="number">3</span>))<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contents</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||
<span class="ident">file_copy</span>.<span class="ident">read_to_end</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">contents</span>)<span class="question-mark">?</span>;
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">contents</span>, <span class="string">b"def\n"</span>);
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
</div><h4 id='method.set_permissions' class="method"><span id='set_permissions.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.set_permissions' class='fnname'>set_permissions</a>(&self, perm: <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.Permissions.html" title="struct std::fs::Permissions">Permissions</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.16.0'>1.16.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/std/fs.rs.html#579-581' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Changes the permissions on the underlying file.</p>
|
||||
<h1 id="platform-specific-behavior" class="section-header"><a href="#platform-specific-behavior">Platform-specific behavior</a></h1>
|
||||
<p>This function currently corresponds to the <code>fchmod</code> function on Unix and
|
||||
the <code>SetFileInformationByHandle</code> function on Windows. Note that, this
|
||||
<a href="../io/index.html#platform-specific-behavior">may change in the future</a>.</p>
|
||||
<h1 id="errors-1" class="section-header"><a href="#errors-1">Errors</a></h1>
|
||||
<p>This function will return an error if the user lacks permission change
|
||||
attributes on the underlying file. It may also return an error in other
|
||||
os-specific unspecified cases.</p>
|
||||
<h1 id="examples-8" class="section-header"><a href="#examples-8">Examples</a></h1>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() <span class="op">-></span> <span class="ident">std</span>::<span class="ident">io</span>::<span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>;
|
||||
|
||||
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">File</span>::<span class="ident">open</span>(<span class="string">"foo.txt"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">perms</span> <span class="op">=</span> <span class="ident">file</span>.<span class="ident">metadata</span>()<span class="question-mark">?</span>.<span class="ident">permissions</span>();
|
||||
<span class="ident">perms</span>.<span class="ident">set_readonly</span>(<span class="bool-val">true</span>);
|
||||
<span class="ident">file</span>.<span class="ident">set_permissions</span>(<span class="ident">perms</span>)<span class="question-mark">?</span>;
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre>
|
||||
<p>Note that this method alters the permissions of the underlying file,
|
||||
even though it takes <code>&self</code> rather than <code>&mut self</code>.</p>
|
||||
</div></div>
|
||||
<h2 id='implementations' class='small-section-header'>
|
||||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='implementations-list'><h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C: <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/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#108' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#108' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Deref' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C> <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C></code><a href='#impl-Deref' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#293-299' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Target' class="type"><span id='Target.t' class='invisible'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target' class="type">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code></span></h4>
|
||||
<div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div><h4 id='method.deref' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></div><div class="content hidden"><h3 class="important">Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></h3><code class="content"><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></code></div></div><span id='deref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref' class='fnname'>deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#296-298' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></div><h3 id='impl-DerefMut' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C> <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html" title="trait core::ops::deref::DerefMut">DerefMut</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C></code><a href='#impl-DerefMut' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#301-305' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.deref_mut' class="method"><div class="important-traits"><div class='tooltip'>ⓘ<span class='tooltiptext'>Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></div><div class="content hidden"><h3 class="important">Important traits for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></h3><code class="content"><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span><span class="where fmt-newline">impl<'a> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for &'a <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></span></code></div></div><span id='deref_mut.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/deref/trait.DerefMut.html#tymethod.deref_mut' class='fnname'>deref_mut</a>(&mut self) -> &mut <a class="struct" href="https://doc.rust-lang.org/nightly/std/fs/struct.File.html" title="struct std::fs::File">File</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#302-304' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Mutably dereferences the value.</p>
|
||||
</div></div><h3 id='impl-Responder' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C: <a class="trait" href="../../actix_web/fs/trait.StaticFileConfig.html" title="trait actix_web::fs::StaticFileConfig">StaticFileConfig</a>> <a class="trait" href="../../actix_web/trait.Responder.html" title="trait actix_web::Responder">Responder</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C></code><a href='#impl-Responder' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#342-481' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Item' class="type"><span id='Item.t' class='invisible'><code>type <a href='../../actix_web/trait.Responder.html#associatedtype.Item' class="type">Item</a> = <a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a></code></span></h4>
|
||||
<div class='docblock'><p>The associated item which can be returned.</p>
|
||||
</div><h4 id='associatedtype.Error' class="type"><span id='Error.t' class='invisible'><code>type <a href='../../actix_web/trait.Responder.html#associatedtype.Error' class="type">Error</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a></code></span></h4>
|
||||
<div class='docblock'><p>The associated error which can be returned.</p>
|
||||
</div><h4 id='method.respond_to' class="method"><span id='respond_to.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/trait.Responder.html#tymethod.respond_to' class='fnname'>respond_to</a><S>(self, req: &<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a><S>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#346-480' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Convert itself to <code>AsyncResult</code> or <code>Error</code>.</p>
|
||||
</div></div></div>
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='synthetic-implementations-list'>
|
||||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C> <span class="where fmt-newline">where<br> C: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>, </span></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<C> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/fs/struct.NamedFile.html" title="struct actix_web::fs::NamedFile">NamedFile</a><C> <span class="where fmt-newline">where<br> C: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>, </span></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -0,0 +1,46 @@
|
||||
<!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 `StaticFiles` struct in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, StaticFiles"><title>actix_web::fs::StaticFiles - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc struct"><!--[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">☰</div><p class='location'>Struct StaticFiles</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.with_pool">with_pool</a><a href="#method.with_config">with_config</a><a href="#method.with_config_pool">with_config_pool</a><a href="#method.show_files_listing">show_files_listing</a><a href="#method.files_listing_renderer">files_listing_renderer</a><a href="#method.index_file">index_file</a><a href="#method.default_handler">default_handler</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Handler%3CS%3E">Handler<S></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">!Send</a><a href="#impl-Sync">!Sync</a></div></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'StaticFiles', ty: 'struct', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="struct" href=''>StaticFiles</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#641-651' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct StaticFiles<S, C = <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a>> { /* fields omitted */ }</pre></div><div class='docblock'><p>Static files handling</p>
|
||||
<p><code>StaticFile</code> handler must be registered with <code>App::handler()</code> method,
|
||||
because <code>StaticFile</code> handler requires access sub-path information.</p>
|
||||
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::{<span class="ident">fs</span>, <span class="ident">App</span>};
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">main</span>() {
|
||||
<span class="kw">let</span> <span class="ident">app</span> <span class="op">=</span> <span class="ident">App</span>::<span class="ident">new</span>()
|
||||
.<span class="ident">handler</span>(<span class="string">"/static"</span>, <span class="ident">fs</span>::<span class="ident">StaticFiles</span>::<span class="ident">new</span>(<span class="string">"."</span>).<span class="ident">unwrap</span>())
|
||||
.<span class="ident">finish</span>();
|
||||
}</pre>
|
||||
</div>
|
||||
<h2 id='methods' class='small-section-header'>
|
||||
Methods<a href='#methods' class='anchor'></a>
|
||||
</h2>
|
||||
<h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<S: 'static> <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S></code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#653-670' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>>>(dir: T) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#659-661' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create new <code>StaticFiles</code> instance for specified base directory.</p>
|
||||
<p><code>StaticFile</code> uses <code>CpuPool</code> for blocking filesystem operations.
|
||||
By default pool with 20 threads is used.
|
||||
Pool size can be changed by setting ACTIX_CPU_POOL environment variable.</p>
|
||||
</div><h4 id='method.with_pool' class="method"><span id='with_pool.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_pool' class='fnname'>with_pool</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>>>(<br> dir: T, <br> pool: CpuPool<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#665-669' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create new <code>StaticFiles</code> instance for specified base directory and
|
||||
<code>CpuPool</code>.</p>
|
||||
</div></div><h3 id='impl-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<S: 'static, C: <a class="trait" href="../../actix_web/fs/trait.StaticFileConfig.html" title="trait actix_web::fs::StaticFileConfig">StaticFileConfig</a>> <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code><a href='#impl-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#672-781' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.with_config' class="method"><span id='with_config.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_config' class='fnname'>with_config</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>>>(<br> dir: T, <br> config: C<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#676-683' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create new <code>StaticFiles</code> instance for specified base directory.</p>
|
||||
<p>Identical with <code>new</code> but allows to specify configiration to use.</p>
|
||||
</div><h4 id='method.with_config_pool' class="method"><span id='with_config_pool.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.with_config_pool' class='fnname'>with_config_pool</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>>>(<br> dir: T, <br> pool: CpuPool, <br> _: C<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#687-709' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Create new <code>StaticFiles</code> instance for specified base directory with config and
|
||||
<code>CpuPool</code>.</p>
|
||||
</div><h4 id='method.show_files_listing' class="method"><span id='show_files_listing.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.show_files_listing' class='fnname'>show_files_listing</a>(self) -> Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#714-717' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Show files listing for directories.</p>
|
||||
<p>By default show files listing is disabled.</p>
|
||||
</div><h4 id='method.files_listing_renderer' class="method"><span id='files_listing_renderer.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.files_listing_renderer' class='fnname'>files_listing_renderer</a><F>(self, f: F) -> Self <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(&'r <a class="struct" href="../../actix_web/fs/struct.Directory.html" title="struct actix_web::fs::Directory">Directory</a>, &'s <a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a><S>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>> + 'static, </span></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#720-728' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set custom directory renderer</p>
|
||||
</div><h4 id='method.index_file' class="method"><span id='index_file.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.index_file' class='fnname'>index_file</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(self, index: T) -> <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#734-737' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set index file</p>
|
||||
<p>Redirects to specific index file for directory "/" instead of
|
||||
showing files listing.</p>
|
||||
</div><h4 id='method.default_handler' class="method"><span id='default_handler.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.default_handler' class='fnname'>default_handler</a><H: <a class="trait" href="../../actix_web/dev/trait.Handler.html" title="trait actix_web::dev::Handler">Handler</a><S>>(self, handler: H) -> <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#740-743' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets default handler which is used when no matched file could be found.</p>
|
||||
</div></div>
|
||||
<h2 id='implementations' class='small-section-header'>
|
||||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='implementations-list'><h3 id='impl-Handler%3CS%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<S: 'static, C: 'static + <a class="trait" href="../../actix_web/fs/trait.StaticFileConfig.html" title="trait actix_web::fs::StaticFileConfig">StaticFileConfig</a>> <a class="trait" href="../../actix_web/dev/trait.Handler.html" title="trait actix_web::dev::Handler">Handler</a><S> for <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code><a href='#impl-Handler%3CS%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#783-792' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Result' class="type"><span id='Result.t' class='invisible'><code>type <a href='../../actix_web/dev/trait.Handler.html#associatedtype.Result' class="type">Result</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../actix_web/dev/struct.AsyncResult.html" title="struct actix_web::dev::AsyncResult">AsyncResult</a><<a class="struct" href="../../actix_web/struct.HttpResponse.html" title="struct actix_web::HttpResponse">HttpResponse</a>>, <a class="struct" href="../../actix_web/error/struct.Error.html" title="struct actix_web::error::Error">Error</a>></code></span></h4>
|
||||
<div class='docblock'><p>The type of value that handler will return.</p>
|
||||
</div><h4 id='method.handle' class="method"><span id='handle.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='../../actix_web/dev/trait.Handler.html#tymethod.handle' class='fnname'>handle</a>(&self, req: &<a class="struct" href="../../actix_web/struct.HttpRequest.html" title="struct actix_web::HttpRequest">HttpRequest</a><S>) -> Self::<a class="type" href="../../actix_web/dev/trait.Handler.html#associatedtype.Result" title="type actix_web::dev::Handler::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/actix_web/fs.rs.html#786-791' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Handle request</p>
|
||||
</div></div></div>
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>
|
||||
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
|
||||
</h2>
|
||||
<div id='synthetic-implementations-list'>
|
||||
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<S, C = <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a>> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl<S, C = <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a>> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../actix_web/fs/struct.StaticFiles.html" title="struct actix_web::fs::StaticFiles">StaticFiles</a><S, C></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
@ -0,0 +1,50 @@
|
||||
<!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 `StaticFileConfig` trait in crate `actix_web`."><meta name="keywords" content="rust, rustlang, rust-lang, StaticFileConfig"><title>actix_web::fs::StaticFileConfig - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></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">☰</div><p class='location'>Trait StaticFileConfig</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.content_disposition_map">content_disposition_map</a><a href="#method.is_use_etag">is_use_etag</a><a href="#method.is_use_last_modifier">is_use_last_modifier</a><a href="#method.is_method_allowed">is_method_allowed</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a></p><script>window.sidebarCurrent = {name: 'StaticFileConfig', 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="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>actix_web</a>::<wbr><a href='index.html'>fs</a>::<wbr><a class="trait" href=''>StaticFileConfig</a></span><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/actix_web/fs.rs.html#59-91' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait StaticFileConfig: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> {
|
||||
fn <a href='#method.content_disposition_map' class='fnname'>content_disposition_map</a>(typ: <a class="struct" href="https://docs.rs/mime/0.3.8/mime/struct.Name.html" title="struct mime::Name">Name</a>) -> <a class="enum" href="../../actix_web/http/header/enum.DispositionType.html" title="enum actix_web::http::header::DispositionType">DispositionType</a> { ... }
|
||||
<div class='item-spacer'></div> fn <a href='#method.is_use_etag' class='fnname'>is_use_etag</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||
<div class='item-spacer'></div> fn <a href='#method.is_use_last_modifier' class='fnname'>is_use_last_modifier</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||
<div class='item-spacer'></div> fn <a href='#method.is_method_allowed' class='fnname'>is_method_allowed</a>(_method: &<a class="struct" href="../../actix_web/http/struct.Method.html" title="struct actix_web::http::Method">Method</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a> { ... }
|
||||
}</pre></div><div class='docblock'><p>Describes <code>StaticFiles</code> configiration</p>
|
||||
<p>To configure actix's static resources you need
|
||||
to define own configiration type and implement any method
|
||||
you wish to customize.
|
||||
As trait implements reasonable defaults for Actix.</p>
|
||||
<h2 id="example" class="section-header"><a href="#example">Example</a></h2>
|
||||
<pre class="rust rust-example-rendered">
|
||||
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">mime</span>;
|
||||
<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">actix_web</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">http</span>::<span class="ident">header</span>::<span class="ident">DispositionType</span>;
|
||||
<span class="kw">use</span> <span class="ident">actix_web</span>::<span class="ident">fs</span>::{<span class="ident">StaticFileConfig</span>, <span class="ident">NamedFile</span>};
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>)]</span>
|
||||
<span class="kw">struct</span> <span class="ident">MyConfig</span>;
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">StaticFileConfig</span> <span class="kw">for</span> <span class="ident">MyConfig</span> {
|
||||
<span class="kw">fn</span> <span class="ident">content_disposition_map</span>(<span class="ident">typ</span>: <span class="ident">mime</span>::<span class="ident">Name</span>) <span class="op">-></span> <span class="ident">DispositionType</span> {
|
||||
<span class="ident">DispositionType</span>::<span class="ident">Attachment</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">NamedFile</span>::<span class="ident">open_with_config</span>(<span class="string">"foo.txt"</span>, <span class="ident">MyConfig</span>);</pre>
|
||||
</div>
|
||||
<h2 id='provided-methods' class='small-section-header'>
|
||||
Provided Methods<a href='#provided-methods' class='anchor'></a>
|
||||
</h2>
|
||||
<div class='methods'>
|
||||
<h3 id='method.content_disposition_map' class='method'><span id='content_disposition_map.v' class='invisible'><code>fn <a href='#method.content_disposition_map' class='fnname'>content_disposition_map</a>(typ: <a class="struct" href="https://docs.rs/mime/0.3.8/mime/struct.Name.html" title="struct mime::Name">Name</a>) -> <a class="enum" href="../../actix_web/http/header/enum.DispositionType.html" title="enum actix_web::http::header::DispositionType">DispositionType</a></code></span></h3><div class='docblock'><p>Describes mapping for mime type to content disposition header</p>
|
||||
<p>By default <code>IMAGE</code>, <code>TEXT</code> and <code>VIDEO</code> are mapped to Inline.
|
||||
Others are mapped to Attachment</p>
|
||||
</div><h3 id='method.is_use_etag' class='method'><span id='is_use_etag.v' class='invisible'><code>fn <a href='#method.is_use_etag' class='fnname'>is_use_etag</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h3><div class='docblock'><p>Describes whether Actix should attempt to calculate <code>ETag</code></p>
|
||||
<p>Defaults to <code>true</code></p>
|
||||
</div><h3 id='method.is_use_last_modifier' class='method'><span id='is_use_last_modifier.v' class='invisible'><code>fn <a href='#method.is_use_last_modifier' class='fnname'>is_use_last_modifier</a>() -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h3><div class='docblock'><p>Describes whether Actix should use last modified date of file.</p>
|
||||
<p>Defaults to <code>true</code></p>
|
||||
</div><h3 id='method.is_method_allowed' class='method'><span id='is_method_allowed.v' class='invisible'><code>fn <a href='#method.is_method_allowed' class='fnname'>is_method_allowed</a>(_method: &<a class="struct" href="../../actix_web/http/struct.Method.html" title="struct actix_web::http::Method">Method</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h3><div class='docblock'><p>Describes allowed methods to access static resources.</p>
|
||||
<p>By default all methods are allowed</p>
|
||||
</div></div>
|
||||
<h2 id='implementors' class='small-section-header'>
|
||||
Implementors<a href='#implementors' class='anchor'></a>
|
||||
</h2>
|
||||
<ul class='item-list' id='implementors-list'>
|
||||
<li><table class='table-display'><tbody><tr><td><code>impl StaticFileConfig for <a class="struct" href="../../actix_web/fs/struct.DefaultConfig.html" title="struct actix_web::fs::DefaultConfig">DefaultConfig</a></code><td><div class='out-of-band'><a class='srclink' href='../../src/actix_web/fs.rs.html#97' title='goto source code'>[src]</a></div></td></tr></tbody></table></li>
|
||||
</ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
|
||||
src="../../implementors/actix_web/fs/trait.StaticFileConfig.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>⏎</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 = "actix_web";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>
|
Reference in New Issue
Block a user