1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-12-18 01:43:58 +01:00
actix-web/actix_multipart/form/trait.FieldReader.html

20 lines
14 KiB
HTML
Raw Normal View History

<!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="Trait that data types to be used in a multipart form struct should implement."><title>FieldReader in actix_multipart::form - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="actix_multipart" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (bdbbb6c6a 2024-05-26)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../../actix_multipart/index.html"><img src="https://actix.rs/img/logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../actix_multipart/index.html"><img src="https://actix.rs/img/logo.png" alt="logo"></a><h2><a href="../../actix_multipart/index.html">actix_multipart</a><span class="version">0.6.1</span></h2></div><h2 class="location"><a href="#">FieldReader</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Future">Future</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.read_field">read_field</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In actix_multipart::form</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">actix_multipart</a>::<wbr><a href="index.html">form</a>::<wbr><a class="trait" href="#">FieldReader</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../../src/actix_multipart/form/mod.rs.html#31-37">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait FieldReader&lt;'t&gt;: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> {
type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt;;
// Required method
fn <a href="#tymethod.read_field" class="fn">read_field</a>(
req: &amp;'t HttpRequest,
field: <a class="struct" href="../struct.Field.html" title="struct actix_multipart::Field">Field</a>,
limits: &amp;'t mut <a class="struct" href="struct.Limits.html" title="struct actix_multipart::form::Limits">Limits</a>
) -&gt; Self::<a class="associatedtype" href="trait.FieldReader.html#associatedtype.Future" title="type actix_multipart::form::FieldReader::Future">Future</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait that data types to be used in a multipart form struct should implement.</p>
<p>It represents an asynchronous handler that processes a multipart field to produce <code>Self</code>.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Future" class="method"><a class="src rightside" href="../../src/actix_multipart/form/mod.rs.html#33">source</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt;</h4></section></summary><div class="docblock"><p>Future that resolves to a <code>Self</code>.</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.read_field" class="method"><a class="src rightside" href="../../src/actix_multipart/form/mod.rs.html#36">source</a><h4 class="code-header">fn <a href="#tymethod.read_field" class="fn">read_field</a>(
req: &amp;'t HttpRequest,
field: <a class="struct" href="../struct.Field.html" title="struct actix_multipart::Field">Field</a>,
limits: &amp;'t mut <a class="struct" href="struct.Limits.html" title="struct actix_multipart::form::Limits">Limits</a>
) -&gt; Self::<a class="associatedtype" href="trait.FieldReader.html#associatedtype.Future" title="type actix_multipart::form::FieldReader::Future">Future</a></h4></section></summary><div class="docblock"><p>The form will call this function to handle the field.</p>
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-FieldReader%3C't%3E-for-Bytes" class="impl"><a class="src rightside" href="../../src/actix_multipart/form/bytes.rs.html#27-49">source</a><a href="#impl-FieldReader%3C't%3E-for-Bytes" class="anchor">§</a><h3 class="code-header">impl&lt;'t&gt; <a class="trait" href="trait.FieldReader.html" title="trait actix_multipart::form::FieldReader">FieldReader</a>&lt;'t&gt; for <a class="struct" href="bytes/struct.Bytes.html" title="struct actix_multipart::form::bytes::Bytes">Bytes</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Future-1" class="associatedtype trait-impl"><a href="#associatedtype.Future-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="bytes/struct.Bytes.html" title="struct actix_multipart::form::bytes::Bytes">Bytes</a>, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt; + 't&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-FieldReader%3C't%3E-for-TempFile" class="impl"><a class="src rightside" href="../../src/actix_multipart/form/tempfile.rs.html#39-81">source</a><a href="#impl-FieldReader%3C't%3E-for-TempFile" class="anchor">§</a><h3 class="code-header">impl&lt;'t&gt; <a class="trait" href="trait.FieldReader.html" title="trait actix_multipart::form::FieldReader">FieldReader</a>&lt;'t&gt; for <a class="struct" href="tempfile/struct.TempFile.html" title="struct actix_multipart::form::tempfile::TempFile">TempFile</a></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>tempfile</code></strong> only.</div></span></section></summary><div class="impl-items"><section id="associatedtype.Future-2" class="associatedtype trait-impl"><a href="#associatedtype.Future-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="tempfile/struct.TempFile.html" title="struct actix_multipart::form::tempfile::TempFile">TempFile</a>, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt; + 't&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-FieldReader%3C't%3E-for-Json%3CT%3E" class="impl"><a class="src rightside" href="../../src/actix_multip
T: <a class="trait" href="https://docs.rs/serde/1.0.203/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Future-3" class="associatedtype trait-impl"><a href="#associatedtype.Future-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="json/struct.Json.html" title="struct actix_multipart::form::json::Json">Json</a>&lt;T&gt;, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt; + 't&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-FieldReader%3C't%3E-for-Text%3CT%3E" class="impl"><a class="src rightside" href="../../src/actix_multipart/form/text.rs.html#30-73">source</a><a href="#impl-FieldReader%3C't%3E-for-Text%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'t, T&gt; <a class="trait" href="trait.FieldReader.html" title="trait actix_multipart::form::FieldReader">FieldReader</a>&lt;'t&gt; for <a class="struct" href="text/struct.Text.html" title="struct actix_multipart::form::text::Text">Text</a>&lt;T&gt;<div class="where">where
T: <a class="trait" href="https://docs.rs/serde/1.0.203/serde/de/trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Future-4" class="associatedtype trait-impl"><a href="#associatedtype.Future-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Future" class="associatedtype">Future</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="text/struct.Text.html" title="struct actix_multipart::form::text::Text">Text</a>&lt;T&gt;, <a class="enum" href="../enum.MultipartError.html" title="enum actix_multipart::MultipartError">MultipartError</a>&gt;&gt; + 't&gt;&gt;</h4></section></div></details></div><script src="../../trait.impl/actix_multipart/form/trait.FieldReader.js" async></script></section></div></main></body></html>