mirror of
https://github.com/actix/actix-website
synced 2025-06-30 16:54:27 +02:00
update stable docs
This commit is contained in:
@ -1,4 +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 `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-1793' title='goto source code'>[src]</a></span></h1><div class='docblock'><p>Static files support</p>
|
||||
<!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'>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<!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#484-491' 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
|
||||
<!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#493-533' 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.8/bytes/bytes/struct.Bytes.html" title="struct bytes::bytes::Bytes">Bytes</a></code></span></h4>
|
||||
<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.8/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#497-532' 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.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>
|
||||
|
@ -1,4 +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 `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#540-545' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct Directory {
|
||||
<!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>
|
||||
@ -17,13 +17,13 @@
|
||||
<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#547-568' 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#549-551' 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#554-567' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Is this entry visible from this directory?</p>
|
||||
<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#539' 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#539' 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 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>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<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 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 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 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> <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.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.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">
|
||||
@ -168,13 +168,13 @@ even though it takes <code>&self</code> rather than <code>&mut self</cod
|
||||
<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 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 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 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> <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.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 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 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 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> <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.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-480' 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><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-479' 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><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>
|
||||
|
@ -1,4 +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 `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#640-650' 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>
|
||||
<!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>
|
||||
|
||||
@ -14,30 +14,30 @@ because <code>StaticFile</code> handler requires access sub-path information.</p
|
||||
<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#652-669' 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#658-660' 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>
|
||||
<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#664-668' 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
|
||||
</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#671-778' 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#675-680' 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>
|
||||
</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#684-706' 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
|
||||
</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#711-714' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Show files listing for directories.</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#717-725' 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#731-734' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Set index file</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#737-740' 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><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#780-789' 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 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#783-788' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Handle request</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>
|
||||
|
Reference in New Issue
Block a user