1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-02 10:59:03 +01:00

Deploying to gh-pages from @ 3b5682c8609d6c521fb3a564730f97ca01160024 🚀

This commit is contained in:
robjtede 2022-09-21 23:25:45 +00:00
parent ca2cb6a870
commit e74cdcecf8
6 changed files with 120 additions and 39 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
var searchIndex = JSON.parse('{\
"actix_cors":{"doc":"Cross-Origin Resource Sharing (CORS) controls for Actix …","t":[13,13,3,4,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["BadRequestHeaders","BadRequestMethod","Cors","CorsError","HeadersNotAllowed","MethodNotAllowed","MissingOrigin","MissingRequestMethod","OriginNotAllowed","WildcardOrigin","allow_any_header","allow_any_method","allow_any_origin","allowed_header","allowed_headers","allowed_methods","allowed_origin","allowed_origin_fn","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","disable_preflight","disable_vary_header","error_response","expose_any_header","expose_headers","fmt","fmt","fmt","from","from","into","into","max_age","new_transform","permissive","provide","send_wildcard","status_code","supports_credentials","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":["actix_cors","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Request header <code>Access-Control-Request-Headers</code> has an …","Request header <code>Access-Control-Request-Method</code> has an …","Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","One or more request headers are not allowed.","Request method is not allowed.","Request header <code>Origin</code> is required but was not provided.","Request header <code>Access-Control-Request-Method</code> is required …","Origin is not allowed to make this request.","Allowed origin argument must not be wildcard (<code>*</code>).","Resets allowed request header list to a state where any …","Resets allowed methods list to all methods.","Resets allowed origin list to a state where any origin is …","Add an allowed request header.","Set a list of request header field names which can be used …","Set a list of methods which allowed origins can perform.","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","","","","","","","A restrictive (security paranoid) set of defaults.","Disable support for preflight requests.","Disable <code>Vary</code> header support.","","Resets exposed response header list to a state where all …","Set a list of headers which are safe to expose to the API …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Set a maximum time (in seconds) for which this CORS …","","A very permissive set of default for quick development. …","","Set to use wildcard origins.","","Allows users to make authenticated requests","","","","","","","","","",""],"i":[3,3,0,0,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,3,1,3,3,3,1,1,1,3,1,1,1,3,3,1,3,1,3,1,1,1,3,1,3,1,3,3,1,3,1,3,1,3,1,3],"f":[0,0,0,0,0,0,0,0,0,0,[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[[1,2],1],[1,1],[[]],[[]],[[]],[[]],[3,3],[[]],[[],1],[1,1],[1,1],[3,4],[1,1],[1,1],[[1,5],6],[[3,5],6],[[3,5],6],[[]],[[]],[[]],[[]],[[1,[9,[[8,[7]]]]],1],[1],[[],1],[10],[1,1],[3,11],[1,1],[[]],[[],12],[[],13],[[],13],[[],13],[[],13],[[],14],[[],14],[[]],[[]]],"p":[[3,"Cors"],[15,"str"],[4,"CorsError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[15,"usize"],[4,"Option"],[8,"Into"],[3,"Demand"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"]]},\
"actix_cors":{"doc":"Cross-Origin Resource Sharing (CORS) controls for Actix …","t":[13,13,3,4,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["BadRequestHeaders","BadRequestMethod","Cors","CorsError","HeadersNotAllowed","MethodNotAllowed","MissingOrigin","MissingRequestMethod","OriginNotAllowed","WildcardOrigin","allow_any_header","allow_any_method","allow_any_origin","allowed_header","allowed_headers","allowed_methods","allowed_origin","allowed_origin_fn","block_on_origin_mismatch","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","disable_preflight","disable_vary_header","error_response","expose_any_header","expose_headers","fmt","fmt","fmt","from","from","into","into","max_age","new_transform","permissive","provide","send_wildcard","status_code","supports_credentials","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":["actix_cors","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["Request header <code>Access-Control-Request-Headers</code> has an …","Request header <code>Access-Control-Request-Method</code> has an …","Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","One or more request headers are not allowed.","Request method is not allowed.","Request header <code>Origin</code> is required but was not provided.","Request header <code>Access-Control-Request-Method</code> is required …","Origin is not allowed to make this request.","Allowed origin argument must not be wildcard (<code>*</code>).","Resets allowed request header list to a state where any …","Resets allowed methods list to all methods.","Resets allowed origin list to a state where any origin is …","Add an allowed request header.","Set a list of request header field names which can be used …","Set a list of methods which allowed origins can perform.","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","Configures whether requests should be pre-emptively …","","","","","","","A restrictive (security paranoid) set of defaults.","Disable support for preflight requests.","Disable <code>Vary</code> header support.","","Resets exposed response header list to a state where all …","Set a list of headers which are safe to expose to the API …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Set a maximum time (in seconds) for which this CORS …","","A very permissive set of default for quick development. …","","Set to use wildcard origins.","","Allows users to make authenticated requests","","","","","","","","","",""],"i":[4,4,0,0,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,4,1,4,4,4,1,1,1,4,1,1,1,4,4,1,4,1,4,1,1,1,4,1,4,1,4,4,1,4,1,4,1,4,1,4],"f":[0,0,0,0,0,0,0,0,0,0,[1,1],[1,1],[1,1],[1,1],[1,1],[1,1],[[1,2],1],[1,1],[[1,3],1],[[]],[[]],[[]],[[]],[4,4],[[]],[[],1],[1,1],[1,1],[4,5],[1,1],[1,1],[[1,6],7],[[4,6],7],[[4,6],7],[[]],[[]],[[]],[[]],[[1,[10,[[9,[8]]]]],1],[1],[[],1],[11],[1,1],[4,12],[1,1],[[]],[[],13],[[],14],[[],14],[[],14],[[],14],[[],15],[[],15],[[]],[[]]],"p":[[3,"Cors"],[15,"str"],[15,"bool"],[4,"CorsError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[15,"usize"],[4,"Option"],[8,"Into"],[3,"Demand"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"]]},\
"actix_identity":{"doc":"Identity management for Actix Web.","t":[3,8,3,11,11,11,11,11,11,11,0,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,3,4,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Identity","IdentityExt","IdentityMiddleware","borrow","borrow","borrow_mut","borrow_mut","builder","clone","clone_into","config","default","from","from","from_request","get_identity","id","into","into","login","logout","new_transform","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","DeleteIdentityKeys","IdentityMiddlewareBuilder","LogoutBehaviour","PurgeSession","borrow","borrow","borrow_mut","borrow_mut","build","clone","clone","clone_into","clone_into","fmt","fmt","from","from","into","into","login_deadline","logout_behaviour","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","visit_deadline","vzip","vzip"],"q":["actix_identity","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_identity::config","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["A verified user identity. It can be used as a request …","Helper trait to retrieve an <code>Identity</code> instance from various …","Identity management middleware.","","","","","A fluent API to configure <code>IdentityMiddleware</code>.","","","Configuration options to tune the behaviour of …","","Returns the argument unchanged.","Returns the argument unchanged.","","Retrieve the identity attached to the current session, if …","Return the user id associated to the current session.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Attach a valid user identity to the current session.","Remove the user identity from the current session.","","","","","","","","","","","When <code>Identity::logout</code> is called, remove the identity …","A fluent builder to construct an <code>IdentityMiddleware</code> …","<code>LogoutBehaviour</code> controls what actions are going to be …","When <code>Identity::logout</code> is called, purge the current session.","","","","","Finalises the builder and returns an <code>IdentityMiddleware</code> …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Automatically logs out users after a certain amount of …","Determines how <code>Identity::logout</code> affects the current …","","","","","","","","","Automatically logs out users after a certain amount of …","",""],"i":[0,0,0,5,2,5,2,2,2,2,0,2,5,2,5,16,5,5,2,5,5,2,2,5,2,5,2,5,2,5,2,11,0,0,11,11,1,11,1,1,11,1,11,1,11,1,11,1,11,1,1,1,11,1,11,1,11,1,11,1,1,11,1],"f":[0,0,0,[[]],[[]],[[]],[[]],[[],1],[2,2],[[]],0,[[],2],[[]],[[]],[[3,4]],[[],[[7,[5,6]]]],[5,[[7,[8,6]]]],[[]],[[]],[[9,8],[[7,[5,6]]]],[5],[2],[[]],[[],7],[[],7],[[],7],[[],7],[[],10],[[],10],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[1,2],[11,11],[1,1],[[]],[[]],[[11,12],13],[[1,12],13],[[]],[[]],[[]],[[]],[[1,[15,[14]]],1],[[1,11],1],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],10],[[],10],[[1,[15,[14]]],1],[[]],[[]]],"p":[[3,"IdentityMiddlewareBuilder"],[3,"IdentityMiddleware"],[3,"HttpRequest"],[4,"Payload"],[3,"Identity"],[3,"Error"],[4,"Result"],[3,"String"],[3,"Extensions"],[3,"TypeId"],[4,"LogoutBehaviour"],[3,"Formatter"],[6,"Result"],[3,"Duration"],[4,"Option"],[8,"IdentityExt"]]},\
"actix_limitation":{"doc":"Rate limiter using a fixed window counter for arbitrary …","t":[3,13,17,17,17,17,4,13,3,13,3,3,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12],"n":["Builder","Client","DEFAULT_COOKIE_NAME","DEFAULT_PERIOD_SECS","DEFAULT_REQUEST_LIMIT","DEFAULT_SESSION_KEY","Error","LimitExceeded","Limiter","Other","RateLimiter","Status","Time","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","builder","clone","clone","clone_into","clone_into","cookie_name","count","default","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","into","key_by","limit","limit","new_transform","period","provide","remaining","reset_epoch_utc","session_key","source","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","0","0","0","0"],"q":["actix_limitation","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_limitation::Error","","",""],"d":["Rate limiter builder.","Redis client failed to connect or run a query.","Default cookie name.","Default period (in seconds).","Default request limit.","Default session key.","Failure modes of the rate limiter.","Limit is exceeded for a key.","Rate limiter.","Generic error.","Rate limit middleware.","A report for a given key containing the limit status.","Time conversion failed.","","","","","","","","","","","Finalizes and returns a <code>Limiter</code>.","Construct rate limiter builder with defaults.","","","","","Sets name of cookie to be sent.","Consumes one rate limit unit, returning the status.","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Sets rate limit key derivation function.","Set upper limit.","Returns the maximum number of requests allowed in the …","","Set limit window/period.","","Returns how many requests are left in the current period.","Returns a UNIX timestamp in UTC approximately when the …","Sets session key to be used in backend.","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,3,0,0,0,0,0,3,0,3,0,0,3,1,3,10,7,2,1,3,10,7,2,1,2,7,2,7,2,1,2,10,1,3,3,10,7,2,1,3,3,3,10,7,2,1,3,10,7,2,1,1,7,10,1,3,7,7,1,3,7,2,3,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2,21,22,23,24],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,[[4,[2,3]]]],[[[6,[5]]],1],[7,7],[2,2],[[]],[[]],[[1,[6,[[9,[8]]]]],1],[[2,[6,[5]]],[[4,[7,3]]]],[[],10],[[1,11],12],[[3,11],12],[[3,11],12],[[10,11],12],[[7,11],12],[[2,11],12],[[]],[[]],[13,3],[14,3],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[[1,15],1],[7,15],[10],[[1,16],1],[17],[7,15],[7,15],[[1,[6,[[9,[8]]]]],1],[3,[[19,[18]]]],[[]],[[]],[[],5],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],20],[[],20],[[],20],[[],20],[[],20],[[]],[[]],[[]],[[]],[[]],0,0,0,0],"p":[[3,"Builder"],[3,"Limiter"],[4,"Error"],[4,"Result"],[3,"String"],[8,"Into"],[3,"Status"],[15,"str"],[4,"Cow"],[3,"RateLimiter"],[3,"Formatter"],[6,"Result"],[3,"ComponentRange"],[3,"RedisError"],[15,"usize"],[3,"Duration"],[3,"Demand"],[8,"Error"],[4,"Option"],[3,"TypeId"],[13,"Client"],[13,"LimitExceeded"],[13,"Time"],[13,"Other"]]},\
"actix_protobuf":{"doc":"Protobuf payload extractor for Actix Web.","t":[12,13,13,13,13,3,3,3,4,8,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12],"n":["0","ContentType","Deserialize","Overflow","Payload","ProtoBuf","ProtoBufConfig","ProtoBufMessage","ProtoBufPayloadError","ProtoBufResponseBuilder","Serialize","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","default","deref","deref_mut","error_response","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_request","into","into","into","into","into_future","limit","limit","new","poll","protobuf","resource_path","respond_to","to_string","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_poll","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","0","0","0"],"q":["actix_protobuf","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_protobuf::ProtoBufPayloadError","",""],"d":["","Content type error","Deserialize error","Payload size is bigger than 256k","Payload error","","","","","","Serialize error","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","Calls <code>U::from(self)</code>.","","Change max size of payload. By default max size is 256Kb","Change max size of payload. By default max size is 256Kb","Create <code>ProtoBufMessage</code> for request.","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[3,4,4,4,4,0,0,0,0,0,4,3,1,14,4,3,1,14,4,1,3,3,4,3,3,4,4,3,1,14,4,4,4,3,3,1,14,4,14,1,14,14,14,23,3,3,3,4,3,1,14,4,3,1,14,4,14,3,1,14,4,3,1,14,4,24,25,26],"f":[0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[[3,[2]]]],[[[3,[2]]]],[4,5],[[[3,[2]],6],7],[[[3,[2]],6],7],[[4,6],7],[[4,6],7],[[]],[[]],[[]],[8,4],[9,4],[[]],[[10,11]],[[]],[[]],[[]],[[]],[[]],[[1,12],1],[[[14,[[0,[2,13]]]],12],[[14,[[0,[2,13]]]]]],[[10,11],[[14,[[0,[2,13]]]]]],[[[15,[[14,[[0,[2,13]]]]]],16],17],[2,[[19,[5,18]]]],[[],20],[[[3,[[0,[2,13]]]],10],5],[[],21],[[],21],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[],19],[[15,16],17],[[],22],[[],22],[[],22],[[],22],[[]],[[]],[[]],[[]],0,0,0],"p":[[3,"ProtoBufConfig"],[8,"Message"],[3,"ProtoBuf"],[4,"ProtoBufPayloadError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[3,"DecodeError"],[4,"PayloadError"],[3,"HttpRequest"],[4,"Payload"],[15,"usize"],[8,"Default"],[3,"ProtoBufMessage"],[3,"Pin"],[3,"Context"],[4,"Poll"],[3,"Error"],[4,"Result"],[3,"Path"],[3,"String"],[3,"TypeId"],[8,"ProtoBufResponseBuilder"],[13,"Serialize"],[13,"Deserialize"],[13,"Payload"]]},\

View File

@ -1,3 +1 @@
<!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="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</title><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="./normalize.css"><link rel="stylesheet" href="./rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="./ayu.css" disabled><link rel="stylesheet" href="./dark.css" disabled><link rel="stylesheet" href="./light.css" id="themeStyle"><script id="default-settings" ></script><script src="./storage.js"></script><script defer src="./main.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="icon" href="https://actix.rs/favicon.ico"></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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="./actix_settings/index.html"><div class="logo-container"><img src="https://actix.rs/img/logo.png" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="./actix_settings/index.html"><div class="logo-container">
<img src="https://actix.rs/img/logo.png" alt="logo"></div></a><h2 class="location">Settings</h2><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="./actix_settings/index.html">
<img src="https://actix.rs/img/logo.png" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="./settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="./wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Rustdoc settings</span></h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section>You need to enable Javascript be able to update your settings.</section></noscript><link rel="stylesheet" type="text/css" href="settings.css"><script defer src="settings.js"></script></section></div></main><div id="rustdoc-vars" data-root-path="./" data-current-crate="actix_settings" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (432abd86f 2022-09-20)" ></div></body></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="Settings of Rustdoc"><meta name="keywords" content="rust, rustlang, rust-lang"><title>Rustdoc settings</title><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="./SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="./normalize.css"><link rel="stylesheet" href="./rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="./ayu.css" disabled><link rel="stylesheet" href="./dark.css" disabled><link rel="stylesheet" href="./light.css" id="themeStyle"><script id="default-settings" ></script><script src="./storage.js"></script><script defer src="./main.js"></script><noscript><link rel="stylesheet" href="./noscript.css"></noscript><link rel="alternate icon" type="image/png" href="./favicon-16x16.png"><link rel="alternate icon" type="image/png" href="./favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="./favicon.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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="./actix_redis/index.html"><div class="logo-container"><img class="rust-logo" src="./rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="./actix_redis/index.html"><div class="logo-container"><img class="rust-logo" src="./rust-logo.svg" alt="logo"></div></a><h2 class="location">Settings</h2><div class="sidebar-elems"></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="./actix_redis/index.html"><img class="rust-logo" src="./rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="./settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="./wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Rustdoc settings</span></h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section>You need to enable Javascript be able to update your settings.</section></noscript><link rel="stylesheet" type="text/css" href="settings.css"><script defer src="settings.js"></script></section></div></main><div id="rustdoc-vars" data-root-path="./" data-current-crate="actix_redis" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (432abd86f 2022-09-20)" ></div></body></html>

View File

@ -641,6 +641,26 @@
<span id="639">639</span>
<span id="640">640</span>
<span id="641">641</span>
<span id="642">642</span>
<span id="643">643</span>
<span id="644">644</span>
<span id="645">645</span>
<span id="646">646</span>
<span id="647">647</span>
<span id="648">648</span>
<span id="649">649</span>
<span id="650">650</span>
<span id="651">651</span>
<span id="652">652</span>
<span id="653">653</span>
<span id="654">654</span>
<span id="655">655</span>
<span id="656">656</span>
<span id="657">657</span>
<span id="658">658</span>
<span id="659">659</span>
<span id="660">660</span>
<span id="661">661</span>
</pre><pre class="rust"><code><span class="kw">use </span>std::{collections::HashSet, convert::TryInto, iter::FromIterator, rc::Rc};
<span class="kw">use </span>actix_utils::future::{<span class="self">self</span>, Ready};
@ -745,6 +765,7 @@
send_wildcard: <span class="bool-val">false</span>,
supports_credentials: <span class="bool-val">true</span>,
vary_header: <span class="bool-val">true</span>,
block_on_origin_mismatch: <span class="bool-val">true</span>,
};
Cors {
@ -1091,6 +1112,24 @@
<span class="self">self
</span>}
<span class="doccomment">/// Configures whether requests should be pre-emptively blocked on mismatched origin.
///
/// If `true`, a 400 Bad Request is returned immediately when a request fails origin validation.
///
/// If `false`, the request will be processed as normal but relevant CORS headers will not be
/// appended to the response. In this case, the browser is trusted to validate CORS headers and
/// and block requests based on pre-flight requests. Use this setting to allow cURL and other
/// non-browser HTTP clients to function as normal, no matter what `Origin` the request has.
///
/// Defaults to `true`.
</span><span class="kw">pub fn </span>block_on_origin_mismatch(<span class="kw-2">mut </span><span class="self">self</span>, block: bool) -&gt; Cors {
<span class="kw">if let </span><span class="prelude-val">Some</span>(cors) = cors(<span class="kw-2">&amp;mut </span><span class="self">self</span>.inner, <span class="kw-2">&amp;</span><span class="self">self</span>.error) {
cors.block_on_origin_mismatch = block
}
<span class="self">self
</span>}
}
<span class="kw">impl </span>Default <span class="kw">for </span>Cors {
@ -1117,6 +1156,7 @@
send_wildcard: <span class="bool-val">false</span>,
supports_credentials: <span class="bool-val">false</span>,
vary_header: <span class="bool-val">true</span>,
block_on_origin_mismatch: <span class="bool-val">true</span>,
};
Cors {

View File

@ -388,6 +388,11 @@
<span id="386">386</span>
<span id="387">387</span>
<span id="388">388</span>
<span id="389">389</span>
<span id="390">390</span>
<span id="391">391</span>
<span id="392">392</span>
<span id="393">393</span>
</pre><pre class="rust"><code><span class="kw">use </span>std::{
collections::HashSet,
convert::{TryFrom, TryInto},
@ -455,16 +460,19 @@
<span class="kw">pub</span>(<span class="kw">crate</span>) send_wildcard: bool,
<span class="kw">pub</span>(<span class="kw">crate</span>) supports_credentials: bool,
<span class="kw">pub</span>(<span class="kw">crate</span>) vary_header: bool,
<span class="kw">pub</span>(<span class="kw">crate</span>) block_on_origin_mismatch: bool,
}
<span class="kw">static </span>EMPTY_ORIGIN_SET: Lazy&lt;HashSet&lt;HeaderValue&gt;&gt; = Lazy::new(HashSet::new);
<span class="kw">impl </span>Inner {
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>validate_origin(<span class="kw-2">&amp;</span><span class="self">self</span>, req: <span class="kw-2">&amp;</span>RequestHead) -&gt; <span class="prelude-ty">Result</span>&lt;(), CorsError&gt; {
<span class="doccomment">/// The bool returned in Ok(_) position indicates whether the `Access-Control-Allow-Origin`
/// header should be added to the response or not.
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>validate_origin(<span class="kw-2">&amp;</span><span class="self">self</span>, req: <span class="kw-2">&amp;</span>RequestHead) -&gt; <span class="prelude-ty">Result</span>&lt;bool, CorsError&gt; {
<span class="comment">// return early if all origins are allowed or get ref to allowed origins set
</span><span class="attribute">#[allow(clippy::mutable_key_type)]
</span><span class="kw">let </span>allowed_origins = <span class="kw">match </span><span class="kw-2">&amp;</span><span class="self">self</span>.allowed_origins {
AllOrSome::All <span class="kw">if </span><span class="self">self</span>.allowed_origins_fns.is_empty() =&gt; <span class="kw">return </span><span class="prelude-val">Ok</span>(()),
AllOrSome::All <span class="kw">if </span><span class="self">self</span>.allowed_origins_fns.is_empty() =&gt; <span class="kw">return </span><span class="prelude-val">Ok</span>(<span class="bool-val">true</span>),
AllOrSome::Some(allowed_origins) =&gt; allowed_origins,
<span class="comment">// only function origin validators are defined
</span><span class="kw">_ </span>=&gt; <span class="kw-2">&amp;</span>EMPTY_ORIGIN_SET,
@ -475,9 +483,11 @@
<span class="comment">// origin header exists and is a string
</span><span class="prelude-val">Some</span>(origin) =&gt; {
<span class="kw">if </span>allowed_origins.contains(origin) || <span class="self">self</span>.validate_origin_fns(origin, req) {
<span class="prelude-val">Ok</span>(())
} <span class="kw">else </span>{
<span class="prelude-val">Ok</span>(<span class="bool-val">true</span>)
} <span class="kw">else if </span><span class="self">self</span>.block_on_origin_mismatch {
<span class="prelude-val">Err</span>(CorsError::OriginNotAllowed)
} <span class="kw">else </span>{
<span class="prelude-val">Ok</span>(<span class="bool-val">false</span>)
}
}

View File

@ -263,6 +263,19 @@
<span id="261">261</span>
<span id="262">262</span>
<span id="263">263</span>
<span id="264">264</span>
<span id="265">265</span>
<span id="266">266</span>
<span id="267">267</span>
<span id="268">268</span>
<span id="269">269</span>
<span id="270">270</span>
<span id="271">271</span>
<span id="272">272</span>
<span id="273">273</span>
<span id="274">274</span>
<span id="275">275</span>
<span id="276">276</span>
</pre><pre class="rust"><code><span class="kw">use </span>std::{collections::HashSet, rc::Rc};
<span class="kw">use </span>actix_utils::future::ok;
@ -281,7 +294,7 @@
<span class="kw">use crate</span>::{
builder::intersperse_header_values,
inner::{add_vary_header, header_value_try_into_method},
AllOrSome, Inner,
AllOrSome, CorsError, Inner,
};
<span class="doccomment">/// Service wrapper for Cross-Origin Resource Sharing support.
@ -325,9 +338,14 @@
</span><span class="kw">fn </span>handle_preflight(<span class="kw-2">&amp;</span><span class="self">self</span>, req: ServiceRequest) -&gt; ServiceResponse {
<span class="kw">let </span>inner = Rc::clone(<span class="kw-2">&amp;</span><span class="self">self</span>.inner);
<span class="kw">match </span>inner.validate_origin(req.head()) {
<span class="prelude-val">Ok</span>(<span class="bool-val">true</span>) =&gt; {}
<span class="prelude-val">Ok</span>(<span class="bool-val">false</span>) =&gt; <span class="kw">return </span>req.error_response(CorsError::OriginNotAllowed),
<span class="prelude-val">Err</span>(err) =&gt; <span class="kw">return </span>req.error_response(err),
};
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = inner
.validate_origin(req.head())
.and_then(|<span class="kw">_</span>| inner.validate_allowed_method(req.head()))
.validate_allowed_method(req.head())
.and_then(|<span class="kw">_</span>| inner.validate_allowed_headers(req.head()))
{
<span class="kw">return </span>req.error_response(err);
@ -373,11 +391,17 @@
req.into_response(res)
}
<span class="kw">fn </span>augment_response&lt;B&gt;(inner: <span class="kw-2">&amp;</span>Inner, <span class="kw-2">mut </span>res: ServiceResponse&lt;B&gt;) -&gt; ServiceResponse&lt;B&gt; {
<span class="kw">if let </span><span class="prelude-val">Some</span>(origin) = inner.access_control_allow_origin(res.request().head()) {
res.headers_mut()
.insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, origin);
};
<span class="kw">fn </span>augment_response&lt;B&gt;(
inner: <span class="kw-2">&amp;</span>Inner,
origin_allowed: bool,
<span class="kw-2">mut </span>res: ServiceResponse&lt;B&gt;,
) -&gt; ServiceResponse&lt;B&gt; {
<span class="kw">if </span>origin_allowed {
<span class="kw">if let </span><span class="prelude-val">Some</span>(origin) = inner.access_control_allow_origin(res.request().head()) {
res.headers_mut()
.insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, origin);
};
}
<span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">ref </span>expose) = inner.expose_headers_baked {
<span class="macro">log::trace!</span>(<span class="string">&quot;exposing selected headers: {:?}&quot;</span>, expose);
@ -447,8 +471,10 @@
}
<span class="comment">// only check actual requests with a origin header
</span><span class="kw">if </span>origin.is_some() {
<span class="kw">if let </span><span class="prelude-val">Err</span>(err) = <span class="self">self</span>.inner.validate_origin(req.head()) {
</span><span class="kw">let </span>origin_allowed = <span class="kw">match </span>(origin, <span class="self">self</span>.inner.validate_origin(req.head())) {
(<span class="prelude-val">None</span>, <span class="kw">_</span>) =&gt; <span class="bool-val">false</span>,
(<span class="kw">_</span>, <span class="prelude-val">Ok</span>(origin_allowed)) =&gt; origin_allowed,
(<span class="kw">_</span>, <span class="prelude-val">Err</span>(err)) =&gt; {
<span class="macro">debug!</span>(<span class="string">&quot;origin validation failed; inner service is not called&quot;</span>);
<span class="kw">let </span><span class="kw-2">mut </span>res = req.error_response(err);
@ -458,14 +484,14 @@
<span class="kw">return </span>ok(res.map_into_right_body()).boxed_local();
}
}
};
<span class="kw">let </span>inner = Rc::clone(<span class="kw-2">&amp;</span><span class="self">self</span>.inner);
<span class="kw">let </span>fut = <span class="self">self</span>.service.call(req);
Box::pin(<span class="kw">async move </span>{
<span class="kw">let </span>res = fut.<span class="kw">await</span>;
<span class="prelude-val">Ok</span>(<span class="self">Self</span>::augment_response(<span class="kw-2">&amp;</span>inner, res<span class="question-mark">?</span>).map_into_left_body())
<span class="prelude-val">Ok</span>(<span class="self">Self</span>::augment_response(<span class="kw-2">&amp;</span>inner, origin_allowed, res<span class="question-mark">?</span>).map_into_left_body())
})
}
}