Files
GopherGate/target/doc/tower/util/index.html
2026-02-26 12:00:21 -05:00

6 lines
15 KiB
HTML

<!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="Various utility types and functions that are generally used with Tower."><title>tower::util - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="tower" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module util</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../tower/index.html">tower</a><span class="version">0.5.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module util</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate tower</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">tower</a></div><h1>Module <span>util</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/tower/util/mod.rs.html#1-1073">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Various utility types and functions that are generally used with Tower.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="error/index.html" title="mod tower::util::error">error</a></dt><dd>Error types</dd><dt><a class="mod" href="future/index.html" title="mod tower::util::future">future</a></dt><dd>Future types</dd><dt><a class="mod" href="rng/index.html" title="mod tower::util::rng">rng</a></dt><dd><a href="https://en.wikipedia.org/wiki/Pseudorandom_number_generator">PRNG</a> utilities for tower middleware.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.AndThen.html" title="struct tower::util::AndThen">AndThen</a></dt><dd>Service returned by the <a href="../trait.ServiceExt.html#method.and_then" title="method tower::ServiceExt::and_then"><code>and_then</code></a> combinator.</dd><dt><a class="struct" href="struct.AndThenLayer.html" title="struct tower::util::AndThenLayer">AndThen<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces a <a href="struct.AndThen.html" title="struct tower::util::AndThen"><code>AndThen</code></a> service.</dd><dt><a class="struct" href="struct.BoxCloneService.html" title="struct tower::util::BoxCloneService">BoxClone<wbr>Service</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> boxed <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</dd><dt><a class="struct" href="struct.BoxCloneServiceLayer.html" title="struct tower::util::BoxCloneServiceLayer">BoxClone<wbr>Service<wbr>Layer</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> boxed <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>.</dd><dt><a class="struct" href="struct.BoxCloneSyncService.html" title="struct tower::util::BoxCloneSyncService">BoxClone<wbr>Sync<wbr>Service</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a> boxed <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</dd><dt><a class="struct" href="struct.BoxCloneSyncServiceLayer.html" title="struct tower::util::BoxCloneSyncServiceLayer">BoxClone<wbr>Sync<wbr>Service<wbr>Layer</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/clone/trait.Clone.html" title="trait core::clone::Clone"><code>Clone</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Send.html" title="trait core::marker::Send"><code>Send</code></a> + <a href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sync.html" title="trait core::marker::Sync"><code>Sync</code></a> boxed <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>.</dd><dt><a class="struct" href="struct.BoxLayer.html" title="struct tower::util::BoxLayer">BoxLayer</a></dt><dd>A boxed <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> trait object.</dd><dt><a class="struct" href="struct.BoxService.html" title="struct tower::util::BoxService">BoxService</a></dt><dd>A boxed <code>Service + Send</code> trait object.</dd><dt><a class="struct" href="struct.CallAll.html" title="struct tower::util::CallAll">CallAll</a></dt><dd>This is a <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream</code></a> of responses resulting from calling the wrapped <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> for each
request received on the wrapped <a href="https://docs.rs/futures/latest/futures/stream/trait.Stream.html"><code>Stream</code></a>.</dd><dt><a class="struct" href="struct.CallAllUnordered.html" title="struct tower::util::CallAllUnordered">Call<wbr>AllUnordered</a></dt><dd>A stream of responses received from the inner service in received order.</dd><dt><a class="struct" href="struct.FutureService.html" title="struct tower::util::FutureService">Future<wbr>Service</a></dt><dd>A type that implements <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> for a <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a> that produces a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>.</dd><dt><a class="struct" href="struct.MapErr.html" title="struct tower::util::MapErr">MapErr</a></dt><dd>Service returned by the <a href="../trait.ServiceExt.html#method.map_err" title="method tower::ServiceExt::map_err"><code>map_err</code></a> combinator.</dd><dt><a class="struct" href="struct.MapErrLayer.html" title="struct tower::util::MapErrLayer">MapErr<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces <a href="struct.MapErr.html" title="struct tower::util::MapErr"><code>MapErr</code></a> services.</dd><dt><a class="struct" href="struct.MapFuture.html" title="struct tower::util::MapFuture">MapFuture</a></dt><dd><a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> returned by the <a href="../trait.ServiceExt.html#method.map_future" title="method tower::ServiceExt::map_future"><code>map_future</code></a> combinator.</dd><dt><a class="struct" href="struct.MapFutureLayer.html" title="struct tower::util::MapFutureLayer">MapFuture<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces a <a href="struct.MapFuture.html" title="struct tower::util::MapFuture"><code>MapFuture</code></a> service.</dd><dt><a class="struct" href="struct.MapRequest.html" title="struct tower::util::MapRequest">MapRequest</a></dt><dd>Service returned by the <a href="../trait.ServiceExt.html#method.map_request" title="method tower::ServiceExt::map_request"><code>MapRequest</code></a> combinator.</dd><dt><a class="struct" href="struct.MapRequestLayer.html" title="struct tower::util::MapRequestLayer">MapRequest<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces <a href="struct.MapRequest.html" title="struct tower::util::MapRequest"><code>MapRequest</code></a> services.</dd><dt><a class="struct" href="struct.MapResponse.html" title="struct tower::util::MapResponse">MapResponse</a></dt><dd>Service returned by the <a href="../trait.ServiceExt.html#method.map_response" title="method tower::ServiceExt::map_response"><code>map_response</code></a> combinator.</dd><dt><a class="struct" href="struct.MapResponseLayer.html" title="struct tower::util::MapResponseLayer">MapResponse<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces a <a href="struct.MapResponse.html" title="struct tower::util::MapResponse"><code>MapResponse</code></a> service.</dd><dt><a class="struct" href="struct.MapResult.html" title="struct tower::util::MapResult">MapResult</a></dt><dd>Service returned by the <a href="../trait.ServiceExt.html#method.map_result" title="method tower::ServiceExt::map_result"><code>map_result</code></a> combinator.</dd><dt><a class="struct" href="struct.MapResultLayer.html" title="struct tower::util::MapResultLayer">MapResult<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces a <a href="struct.MapResult.html" title="struct tower::util::MapResult"><code>MapResult</code></a> service.</dd><dt><a class="struct" href="struct.Oneshot.html" title="struct tower::util::Oneshot">Oneshot</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a> consuming a <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> and request, waiting until the <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a>
is ready, and then calling <a href="../trait.Service.html#tymethod.call" title="method tower::Service::call"><code>Service::call</code></a> with the request, and
waiting for that <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a>.</dd><dt><a class="struct" href="struct.Optional.html" title="struct tower::util::Optional">Optional</a></dt><dd>Optionally forwards requests to an inner service.</dd><dt><a class="struct" href="struct.Ready.html" title="struct tower::util::Ready">Ready</a></dt><dd>A future that yields a mutable reference to the service when it is ready to accept a request.</dd><dt><a class="struct" href="struct.ReadyOneshot.html" title="struct tower::util::ReadyOneshot">Ready<wbr>Oneshot</a></dt><dd>A <a href="https://doc.rust-lang.org/1.93.1/core/future/future/trait.Future.html" title="trait core::future::future::Future"><code>Future</code></a> that yields the service when it is ready to accept a request.</dd><dt><a class="struct" href="struct.ServiceFn.html" title="struct tower::util::ServiceFn">Service<wbr>Fn</a></dt><dd>A <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> implemented by a closure.</dd><dt><a class="struct" href="struct.Then.html" title="struct tower::util::Then">Then</a></dt><dd><a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> returned by the <a href="../trait.ServiceExt.html#method.then" title="method tower::ServiceExt::then"><code>then</code></a> combinator.</dd><dt><a class="struct" href="struct.ThenLayer.html" title="struct tower::util::ThenLayer">Then<wbr>Layer</a></dt><dd>A <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a> that produces a <a href="struct.Then.html" title="struct tower::util::Then"><code>Then</code></a> service.</dd><dt><a class="struct" href="struct.UnsyncBoxService.html" title="struct tower::util::UnsyncBoxService">Unsync<wbr>BoxService</a></dt><dd>A boxed <a href="../trait.Service.html" title="trait tower::Service"><code>Service</code></a> trait object.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Either.html" title="enum tower::util::Either">Either</a></dt><dd>Combine two different service types into a single type.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.ServiceExt.html" title="trait tower::util::ServiceExt">Service<wbr>Ext</a></dt><dd>An extension trait for <code>Service</code>s that provides a variety of convenient
adapters</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.future_service.html" title="fn tower::util::future_service">future_<wbr>service</a></dt><dd>Returns a new <a href="struct.FutureService.html" title="struct tower::util::FutureService"><code>FutureService</code></a> for the given future.</dd><dt><a class="fn" href="fn.option_layer.html" title="fn tower::util::option_layer">option_<wbr>layer</a></dt><dd>Convert an <code>Option&lt;Layer&gt;</code> into a <a href="../trait.Layer.html" title="trait tower::Layer"><code>Layer</code></a>.</dd><dt><a class="fn" href="fn.service_fn.html" title="fn tower::util::service_fn">service_<wbr>fn</a></dt><dd>Returns a new <a href="struct.ServiceFn.html" title="struct tower::util::ServiceFn"><code>ServiceFn</code></a> with the given closure.</dd></dl></section></div></main></body></html>