2023-01-13 11:46:16 +01:00
<!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 = "Middleware for checking HTTP authentication." > < meta name = "keywords" content = "rust, rustlang, rust-lang, HttpAuthentication" > < title > HttpAuthentication in actix_web_httpauth::middleware - Rust< / title > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/SourceSerif4-Regular-1f7d512b176f0f72.ttf.woff2" > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2" > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2" > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2" > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/SourceSerif4-Bold-124a1ca42af929b6.ttf.woff2" > < link rel = "preload" as = "font" type = "font/woff2" crossorigin href = "../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2" > < link rel = "stylesheet" href = "../../static.files/normalize-76eba96aa4d2e634.css" > < link rel = "stylesheet" href = "../../static.files/rustdoc-c722f88035d2892e.css" id = "mainThemeStyle" > < link rel = "stylesheet" id = "themeStyle" href = "../../static.files/light-4743e13df3dfe8c4.css" > < link rel = "stylesheet" disabled href = "../../static.files/dark-0e1b889528bd466b.css" > < link rel = "stylesheet" disabled href = "../../static.files/ayu-65289d5d067c7c66.css" > < script id = "default-settings" > < / script > < script src = "../../static.files/storage-d43fa987303ecbbb.js" > < / script > < script defer src = "sidebar-items.js" > < / script > < script defer src = "../../static.files/main-bc1b32400f872ddb.js" > < / script > < noscript > < link rel = "stylesheet" href = "../../static.files/noscript-13285aec31fa243e.css" > < / noscript > < link rel = "alternate icon" type = "image/png" href = "../../static.files/favicon-16x16-8b506e7a72182f1c.png" > < link rel = "alternate icon" type = "image/png" href = "../../static.files/favicon-32x32-422f7d1d52889060.png" > < link rel = "icon" type = "image/svg+xml" href = "../../static.files/favicon-2c020d218678b618.svg" > < / head > < body class = "rustdoc struct" > <!-- [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" > ☰ < / button > < a class = "logo-container" href = "../../actix_web_httpauth/index.html" > < img class = "rust-logo" src = "../../static.files/rust-logo-151179464ae7ed46.svg" alt = "logo" > < / a > < h2 > < / h2 > < / nav > < nav class = "sidebar" > < a class = "logo-container" href = "../../actix_web_httpauth/index.html" > < img class = "rust-logo" src = "../../static.files/rust-logo-151179464ae7ed46.svg" alt = "logo" > < / a > < h2 class = "location" > < a href = "#" > HttpAuthentication< / a > < / h2 > < div class = "sidebar-elems" > < section > < h3 > < a href = "#implementations" > Methods< / a > < / h3 > < ul class = "block" > < li > < a href = "#method.basic" > basic< / a > < / li > < li > < a href = "#method.bearer" > bearer< / a > < / li > < li > < a href = "#method.with_fn" > with_fn< / a > < / li > < / ul > < h3 > < a href = "#trait-implementations" > Trait Implementations< / a > < / h3 > < ul class = "block" > < li > < a href = "#impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" > Clone< / a > < / li > < li > < a href = "#impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" > Debug< / a > < / li > < li > < a href = "#impl-Transform%3CS%2C%20ServiceRequest%3E-for-HttpAuthentication%3CT%2C%20F%3E" > Transform< S, ServiceRequest> < / a > < / li > < / ul > < h3 > < a href = "#synthetic-implementations" > Auto Trait Implementations< / a > < / h3 > < ul class = "block" > < li > < a href = "#impl-RefUnwindSafe-for-HttpAuthentication%3CT%2C%20F%3E" > RefUnwindSafe< / a > < / li > < li > < a href = "#impl-Send-for-HttpAuthentication%3CT%2C%20F%3E" > Send< / a > < / li > < li > < a href = "#impl-Sync-for-HttpAuthentication%3CT%2C%20F%3E" > Sync< / a > < / li > < li > < a href = "#impl-Unpin-for-HttpAuthentication%3CT%2C%20F%3E" > Unpin< / a > < / li > < li > < a href = "#impl-UnwindSafe-for-HttpAuthentication%3CT%2C%20F%3E" > UnwindSafe< / a > < / li > < / ul > < h3 > < a href = "#blanket-implementations" > Blan
2021-03-22 12:49:07 +01:00
< p > If there is no < code > Authorization< / code > header in the request, this middleware returns an error
immediately, without calling the < code > F< / code > callback.< / p >
< p > Otherwise, it will pass both the request and the parsed credentials into it. In case of
successful validation < code > F< / code > callback is required to return the < code > ServiceRequest< / code > back.< / p >
2022-12-01 11:49:14 +01:00
< / div > < / details > < h2 id = "implementations" class = "small-section-header" > Implementations< a href = "#implementations" class = "anchor" > §< / a > < / h2 > < div id = "implementations-list" > < details class = "rustdoc-toggle implementors-toggle" open > < summary > < section id = "impl-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#38-52" > source< / a > < a href = "#impl-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T, F, O> < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < T, F> < span class = "where fmt-newline" > where< br > T: FromRequest,< 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 > (ServiceRequest, T) -> O,< br > O: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title = "trait core::future::future::Future" > Future< / a > < Output = < a class = "enum" href = "https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title = "enum core::result::Result" > Result< / a > < ServiceRequest, (Error, ServiceRequest)> > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.with_fn" class = "method has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#46-51" > source< / a > < h4 class = "code-header" > pub fn < a href = "#method.with_fn" class = "fn" > with_fn< / a > (process_fn: F) -> < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < T, F> < / h4 > < / section > < / summary > < div class = "docblock" > < p > Construct < code > HttpAuthentication< / code > middleware with the provided auth extractor < code > T< / code > and
2021-03-22 12:49:07 +01:00
validation callback < code > F< / code > .< / p >
2022-12-01 11:49:14 +01:00
< / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" open > < summary > < section id = "impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#54-81" > source< / a > < a href = "#impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< F, O> < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < < a class = "struct" href = "../extractors/basic/struct.BasicAuth.html" title = "struct actix_web_httpauth::extractors::basic::BasicAuth" > BasicAuth< / a > , F> < 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 > (ServiceRequest, < a class = "struct" href = "../extractors/basic/struct.BasicAuth.html" title = "struct actix_web_httpauth::extractors::basic::BasicAuth" > BasicAuth< / a > ) -> O,< br > O: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title = "trait core::future::future::Future" > Future< / a > < Output = < a class = "enum" href = "https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title = "enum core::result::Result" > Result< / a > < ServiceRequest, (Error, ServiceRequest)> > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.basic" class = "method has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#78-80" > source< / a > < h4 class = "code-header" > pub fn < a href = "#method.basic" class = "fn" > basic< / a > (process_fn: F) -> Self< / h4 > < / section > < / summary > < div class = "docblock" > < p > Construct < code > HttpAuthentication< / code > middleware for the HTTP “Basic” authentication scheme.< / p >
2022-07-21 03:52:33 +02:00
< h5 id = "examples" > < a href = "#examples" > Examples< / a > < / h5 >
2022-08-24 19:10:06 +02:00
< div class = "example-wrap" > < pre class = "rust rust-example-rendered" > < code > < span class = "comment" > // In this example validator returns immediately, but since it is required to return
// anything that implements `IntoFuture` trait, it can be extended to query database or to
// do something else in a async manner.
< / span > < span class = "kw" > async fn < / span > validator(
req: ServiceRequest,
credentials: BasicAuth,
) -> < span class = "prelude-ty" > Result< / span > < ServiceRequest, (Error, ServiceRequest)> {
< span class = "comment" > // All users are great and more than welcome!
< / span > < span class = "prelude-val" > Ok< / span > (req)
2021-03-22 12:49:07 +01:00
}
2022-08-24 19:10:06 +02:00
< span class = "kw" > let < / span > middleware = HttpAuthentication::basic(validator);< / code > < / pre > < / div >
2022-12-01 11:49:14 +01:00
< / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" open > < summary > < section id = "impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#83-118" > source< / a > < a href = "#impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< F, O> < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < < a class = "struct" href = "../extractors/bearer/struct.BearerAuth.html" title = "struct actix_web_httpauth::extractors::bearer::BearerAuth" > BearerAuth< / a > , F> < 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 > (ServiceRequest, < a class = "struct" href = "../extractors/bearer/struct.BearerAuth.html" title = "struct actix_web_httpauth::extractors::bearer::BearerAuth" > BearerAuth< / a > ) -> O,< br > O: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title = "trait core::future::future::Future" > Future< / a > < Output = < a class = "enum" href = "https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title = "enum core::result::Result" > Result< / a > < ServiceRequest, (Error, ServiceRequest)> > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.bearer" class = "method has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#115-117" > source< / a > < h4 class = "code-header" > pub fn < a href = "#method.bearer" class = "fn" > bearer< / a > (process_fn: F) -> Self< / h4 > < / section > < / summary > < div class = "docblock" > < p > Construct < code > HttpAuthentication< / code > middleware for the HTTP “Bearer” authentication scheme.< / p >
2022-07-21 03:52:33 +02:00
< h5 id = "examples-1" > < a href = "#examples-1" > Examples< / a > < / h5 >
2022-08-24 19:10:06 +02:00
< div class = "example-wrap" > < pre class = "rust rust-example-rendered" > < code > < span class = "kw" > async fn < / span > validator(
req: ServiceRequest,
credentials: BearerAuth
) -> < span class = "prelude-ty" > Result< / span > < ServiceRequest, (Error, ServiceRequest)> {
< span class = "kw" > if < / span > credentials.token() == < span class = "string" > " mF_9.B5f-4.1JqM" < / span > {
< span class = "prelude-val" > Ok< / span > (req)
} < span class = "kw" > else < / span > {
< span class = "kw" > let < / span > config = req.app_data::< bearer::Config> ()
.cloned()
.unwrap_or_default()
.scope(< span class = "string" > " urn:example:channel=HBO& urn:example:rating=G,PG-13" < / span > );
2021-03-22 12:49:07 +01:00
2022-08-24 19:10:06 +02:00
< span class = "prelude-val" > Err< / span > ((AuthenticationError::from(config).into(), req))
2021-03-22 12:49:07 +01:00
}
}
2022-08-24 19:10:06 +02:00
< span class = "kw" > let < / span > middleware = HttpAuthentication::bearer(validator);< / code > < / pre > < / div >
2023-01-05 15:38:37 +01:00
< / div > < / details > < / div > < / details > < / div > < h2 id = "trait-implementations" class = "small-section-header" > Trait Implementations< a href = "#trait-implementations" class = "anchor" > §< / a > < / h2 > < div id = "trait-implementations-list" > < details class = "rustdoc-toggle implementors-toggle" open > < summary > < section id = "impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#29" > source< / a > < a href = "#impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T, F: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title = "trait core::clone::Clone" > Clone< / a > > < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title = "trait core::clone::Clone" > Clone< / a > for < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < T, F> < span class = "where fmt-newline" > where< br > T: FromRequest + < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title = "trait core::clone::Clone" > Clone< / a > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.clone" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#29" > source< / a > < a href = "#method.clone" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class = "fn" > clone< / a > (& self) -> < a class = "struct" href = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < T, F> < / h4 > < / section > < / summary > < div class = 'docblock' > Returns a copy of the value. < a href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" > Read more< / a > < / div > < / details > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.clone_from" class = "method trait-impl has-srclink" > < span class = "rightside" > < span class = "since" title = "Stable since Rust version 1.0.0" > 1.0.0< / span > · < a class = "srclink" href = "https://doc.rust-lang.org/nightly/src/core/clone.rs.html#132-134" > source< / a > < / span > < a href = "#method.clone_from" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class = "fn" > clone_from< / a > (& mut self, source: < a class = "primitive" href = "https://doc.rust-lang.org/nightly/std/primitive.reference.html" > & < / a > Self)< / h4 > < / section > < / summary > < div class = 'docblock' > Performs copy-assignment from < code > source< / code > . < a href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" > Read more< / a > < / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" open > < summary > < section id = "impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "../../src/actix_web_httpauth/middleware.rs.html#29" > source< / a > < a href = "#impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T, F: < 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 = "struct.HttpAuthentication.html" title = "struct actix_web_httpauth::middleware::HttpAuthentication" > HttpAuthentication< / a > < T, F> < span class = "where fmt-newline" > where< br > T: FromRequest + < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title = "trait core::fmt::Debug" > Debug< / a > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.fmt" class = "method trait-impl
2022-12-01 11:49:14 +01:00
< / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" > < summary > < section id = "impl-Instrument-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#276" > source< / a > < a href = "#impl-Instrument-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T> < a class = "trait" href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html" title = "trait tracing::instrument::Instrument" > Instrument< / a > for T< / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.instrument" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#82" > source< / a > < a href = "#method.instrument" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument" class = "fn" > instrument< / a > (self, span: < a class = "struct" href = "https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title = "struct tracing::span::Span" > Span< / a > ) -> < a class = "struct" href = "https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title = "struct tracing::instrument::Instrumented" > Instrumented< / a > < Self> < / h4 > < / section > < / summary > < div class = 'docblock' > Instruments this type with the provided < a href = "https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" title = "Span" > < code > Span< / code > < / a > , returning an
< code > Instrumented< / code > wrapper. < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.instrument" > Read more< / a > < / div > < / details > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.in_current_span" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#121" > source< / a > < a href = "#method.in_current_span" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span" class = "fn" > in_current_span< / a > (self) -> < a class = "struct" href = "https://docs.rs/tracing/0.1.37/tracing/instrument/struct.Instrumented.html" title = "struct tracing::instrument::Instrumented" > Instrumented< / a > < Self> < / h4 > < / section > < / summary > < div class = 'docblock' > Instruments this type with the < a href = "https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html#method.current" > current< / a > < a href = "https://docs.rs/tracing/0.1.37/tracing/span/struct.Span.html" > < code > Span< / code > < / a > , returning an
< code > Instrumented< / code > wrapper. < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.Instrument.html#method.in_current_span" > Read more< / a > < / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" > < summary > < section id = "impl-Into%3CU%3E-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#717" > source< / a > < a href = "#impl-Into%3CU%3E-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T, U> < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title = "trait core::convert::Into" > Into< / a > < U> for T< span class = "where fmt-newline" > where< br > U: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title = "trait core::convert::From" > From< / a > < T> ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.into" class = "method trait-impl has-srclink" > < span class = "rightside" > < span class = "since" title = "const unstable" > const: < a href = "https://github.com/rust-lang/rust/issues/88674" title = "Tracking issue for const_convert" > unstable< / a > < / span > · < a class = "srclink" href = "https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#725" > source< / a > < / span > < a href = "#method.into" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class = "fn" > into< / a > (self) -> U< / h4 > < / section > < / summary > < div class = "docblock" > < p > Calls < code > U::from(self)< / code > .< / p >
2022-02-18 04:35:44 +01:00
< p > That is, this conversion is whatever the implementation of
< code > < a href = "https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title = "From" > From< / a > < T> for U< / code > chooses to do.< / p >
2023-01-07 02:06:41 +01:00
< / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" > < summary > < section id = "impl-Same%3CT%3E-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "https://docs.rs/typenum/1.16.0/src/typenum/type_operators.rs.html#34" > source< / a > < a href = "#impl-Same%3CT%3E-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T> < a class = "trait" href = "https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html" title = "trait typenum::type_operators::Same" > Same< / a > < T> for T< / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle" open > < summary > < section id = "associatedtype.Output" class = "associatedtype trait-impl has-srclink" > < a href = "#associatedtype.Output" class = "anchor" > §< / a > < h4 class = "code-header" > type < a href = "https://docs.rs/typenum/1.16.0/typenum/type_operators/trait.Same.html#associatedtype.Output" class = "associatedtype" > Output< / a > = T< / h4 > < / section > < / summary > < div class = 'docblock' > Should always be < code > Self< / code > < / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" > < summary > < section id = "impl-ToOwned-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#82" > source< / a > < a href = "#impl-ToOwned-for-HttpAuthentication%3CT%2C%20F%3E" class = "anchor" > §< / a > < h3 class = "code-header" > impl< T> < a class = "trait" href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title = "trait alloc::borrow::ToOwned" > ToOwned< / a > for T< span class = "where fmt-newline" > where< br > T: < a class = "trait" href = "https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title = "trait core::clone::Clone" > Clone< / a > ,< / span > < / h3 > < / section > < / summary > < div class = "impl-items" > < details class = "rustdoc-toggle" open > < summary > < section id = "associatedtype.Owned" class = "associatedtype trait-impl has-srclink" > < a href = "#associatedtype.Owned" class = "anchor" > §< / a > < h4 class = "code-header" > type < a href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class = "associatedtype" > Owned< / a > = T< / h4 > < / section > < / summary > < div class = 'docblock' > The resulting type after obtaining ownership.< / div > < / details > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.to_owned" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#87" > source< / a > < a href = "#method.to_owned" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class = "fn" > to_owned< / a > (& self) -> T< / h4 > < / section > < / summary > < div class = 'docblock' > Creates owned data from borrowed data, usually by cloning. < a href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" > Read more< / a > < / div > < / details > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.clone_into" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#91" > source< / a > < a href = "#method.clone_into" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" class = "fn" > clone_into< / a > (& self, target: < a class = "primitive" href = "https://doc.rust-lang.org/nightly/std/primitive.reference.html" > & mut < / a > T)< / h4 > < / section > < / summary > < div class = 'docblock' > Uses borrowed data to replace owned data, usually by cloning. < a href = "https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into" > Read more< / a > < / div > < / details > < / div > < / details > < details class = "rustdoc-toggle implementors-toggle" > < summary > < section id = "impl-TryFrom%3CU%3E-for-HttpAuthentication%3CT%2C%20F%3E" class = "impl has-srclink" > < a class = "srclink rightside" href = "https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#775" > source< / a > < a href = "#impl-Try
2022-12-01 11:49:14 +01:00
< a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title = "WithDispatch" > < code > WithDispatch< / code > < / a > wrapper. < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_subscriber" > Read more< / a > < / div > < / details > < details class = "rustdoc-toggle method-toggle" open > < summary > < section id = "method.with_current_subscriber" class = "method trait-impl has-srclink" > < a class = "srclink rightside" href = "https://docs.rs/tracing/0.1.37/src/tracing/instrument.rs.html#221" > source< / a > < a href = "#method.with_current_subscriber" class = "anchor" > §< / a > < h4 class = "code-header" > fn < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" class = "fn" > with_current_subscriber< / a > (self) -> < a class = "struct" href = "https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title = "struct tracing::instrument::WithDispatch" > WithDispatch< / a > < Self> < / h4 > < / section > < / summary > < div class = 'docblock' > Attaches the current < a href = "https://docs.rs/tracing/0.1.37/tracing/dispatcher/index.html#setting-the-default-subscriber" > default< / a > < a href = "https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html" > < code > Subscriber< / code > < / a > to this type, returning a
2023-01-13 11:46:16 +01:00
< a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/struct.WithDispatch.html" title = "WithDispatch" > < code > WithDispatch< / code > < / a > wrapper. < a href = "https://docs.rs/tracing/0.1.37/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber" > Read more< / a > < / div > < / details > < / div > < / details > < / div > < / section > < / div > < / main > < div id = "rustdoc-vars" data-root-path = "../../" data-static-root-path = "../../static.files/" data-current-crate = "actix_web_httpauth" data-themes = "" data-resource-suffix = "" data-rustdoc-version = "1.68.0-nightly (61a415be5 2023-01-12)" data-search-js = "search-181581080540673f.js" data-settings-js = "settings-bebeae96e00e4617.js" data-settings-css = "settings-58836c674e2f7bd2.css" > < / div > < / body > < / html >