diff --git a/actix_settings/actix/enum.Backlog.html b/actix_settings/actix/enum.Backlog.html new file mode 100644 index 000000000..9de7f4d6d --- /dev/null +++ b/actix_settings/actix/enum.Backlog.html @@ -0,0 +1,11 @@ + + +
+ +Redirecting to ../../actix_settings/enum.Backlog.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.KeepAlive.html b/actix_settings/actix/enum.KeepAlive.html new file mode 100644 index 000000000..0269e6528 --- /dev/null +++ b/actix_settings/actix/enum.KeepAlive.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.KeepAlive.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.MaxConnectionRate.html b/actix_settings/actix/enum.MaxConnectionRate.html new file mode 100644 index 000000000..63f9563e5 --- /dev/null +++ b/actix_settings/actix/enum.MaxConnectionRate.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.MaxConnectionRate.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.MaxConnections.html b/actix_settings/actix/enum.MaxConnections.html new file mode 100644 index 000000000..e564bb223 --- /dev/null +++ b/actix_settings/actix/enum.MaxConnections.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.MaxConnections.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.Mode.html b/actix_settings/actix/enum.Mode.html new file mode 100644 index 000000000..0f580e152 --- /dev/null +++ b/actix_settings/actix/enum.Mode.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.Mode.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.NumWorkers.html b/actix_settings/actix/enum.NumWorkers.html new file mode 100644 index 000000000..459b7962c --- /dev/null +++ b/actix_settings/actix/enum.NumWorkers.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.NumWorkers.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/enum.Timeout.html b/actix_settings/actix/enum.Timeout.html new file mode 100644 index 000000000..bb47f8d96 --- /dev/null +++ b/actix_settings/actix/enum.Timeout.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/enum.Timeout.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/struct.ActixSettings.html b/actix_settings/actix/struct.ActixSettings.html new file mode 100644 index 000000000..170d45a0c --- /dev/null +++ b/actix_settings/actix/struct.ActixSettings.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/struct.ActixSettings.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/struct.Address.html b/actix_settings/actix/struct.Address.html new file mode 100644 index 000000000..ad9a9d34b --- /dev/null +++ b/actix_settings/actix/struct.Address.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/struct.Address.html...
+ + + \ No newline at end of file diff --git a/actix_settings/actix/struct.Tls.html b/actix_settings/actix/struct.Tls.html new file mode 100644 index 000000000..ef2e7521c --- /dev/null +++ b/actix_settings/actix/struct.Tls.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/struct.Tls.html...
+ + + \ No newline at end of file diff --git a/actix_settings/all.html b/actix_settings/all.html new file mode 100644 index 000000000..a681b4fc9 --- /dev/null +++ b/actix_settings/all.html @@ -0,0 +1 @@ +Redirecting to ../../actix_settings/trait.Parse.html...
+ + + \ No newline at end of file diff --git a/actix_settings/enum.AtError.html b/actix_settings/enum.AtError.html new file mode 100644 index 000000000..76ab46053 --- /dev/null +++ b/actix_settings/enum.AtError.html @@ -0,0 +1,49 @@ +pub enum AtError {
+ EnvVarError(VarError),
+ FileExists(PathBuf),
+ InvalidValue {
+ expected: &'static str,
+ got: String,
+ file: &'static str,
+ line: u32,
+ column: u32,
+ },
+ IoError(IoError),
+ ParseBoolError(ParseBoolError),
+ ParseIntError(ParseIntError),
+ ParseAddressError(String),
+ TomlError(TomlError),
+}
EnvVarError(VarError)
FileExists(PathBuf)
InvalidValue
IoError(IoError)
ParseBoolError(ParseBoolError)
ParseIntError(ParseIntError)
ParseAddressError(String)
TomlError(TomlError)
Converts to this type from the input type.
+Converts to this type from the input type.
+Mutably borrows from an owned value. Read more
+Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum Backlog {
+ Default,
+ Manual(usize),
+}
Default
Manual(usize)
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum KeepAlive {
+ Default,
+ Disabled,
+ Os,
+ Seconds(usize),
+}
Default
Disabled
Os
Seconds(usize)
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum MaxConnectionRate {
+ Default,
+ Manual(usize),
+}
Default
Manual(usize)
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+This method tests for self
and other
values to be equal, and is used
+by ==
. Read more
This method tests for !=
.
Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum MaxConnections {
+ Default,
+ Manual(usize),
+}
Default
Manual(usize)
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+This method tests for self
and other
values to be equal, and is used
+by ==
. Read more
This method tests for !=
.
Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum Mode {
+ Development,
+ Production,
+}
Development
Production
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub enum NumWorkers {
+ Default,
+ Manual(usize),
+}
Default
Manual(usize)
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+This method tests for self
and other
values to be equal, and is used
+by ==
. Read more
This method tests for !=
.
Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Default
Milliseconds(usize)
Seconds(usize)
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Redirecting to ../../actix_settings/enum.AtError.html...
+ + + \ No newline at end of file diff --git a/actix_settings/error/type.AtResult.html b/actix_settings/error/type.AtResult.html new file mode 100644 index 000000000..6323750e4 --- /dev/null +++ b/actix_settings/error/type.AtResult.html @@ -0,0 +1,11 @@ + + + + +Redirecting to ../../actix_settings/type.AtResult.html...
+ + + \ No newline at end of file diff --git a/actix_settings/index.html b/actix_settings/index.html new file mode 100644 index 000000000..aea0dee55 --- /dev/null +++ b/actix_settings/index.html @@ -0,0 +1,2 @@ +pub struct ActixSettings {Show 13 fields
+ pub hosts: Vec<Address>,
+ pub mode: Mode,
+ pub enable_compression: bool,
+ pub enable_log: bool,
+ pub num_workers: NumWorkers,
+ pub backlog: Backlog,
+ pub max_connections: MaxConnections,
+ pub max_connection_rate: MaxConnectionRate,
+ pub keep_alive: KeepAlive,
+ pub client_timeout: Timeout,
+ pub client_shutdown: Timeout,
+ pub shutdown_timeout: Timeout,
+ pub tls: Tls,
+}
Settings types for Actix Web.
+hosts: Vec<Address>
mode: Mode
enable_compression: bool
enable_log: bool
num_workers: NumWorkers
backlog: Backlog
max_connections: MaxConnections
max_connection_rate: MaxConnectionRate
keep_alive: KeepAlive
client_timeout: Timeout
client_shutdown: Timeout
shutdown_timeout: Timeout
tls: Tls
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+This method tests for self
and other
values to be equal, and is used
+by ==
. Read more
This method tests for !=
.
Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
host: String
port: u16
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub struct BasicSettings<A> {
+ pub actix: ActixSettings,
+ pub application: A,
+}
actix: ActixSettings
application: A
Parse an instance of Self
from a TOML
file located at filepath
.
+If the file doesn’t exist, it is generated from the default TOML
+template, after which the newly generated file is read in and parsed.
Parse an instance of Self
straight from the default TOML
template.
Parse an instance of Self
straight from the default TOML
template.
Write the default TOML
template to a new file, to be located
+at filepath
. Return a Error::FileExists(_)
error if a
+file already exists at that location.
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+This method tests for self
and other
values to be equal, and is used
+by ==
. Read more
This method tests for !=
.
Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
#[non_exhaustive]pub struct NoSettings {}
Returns a copy of the value. Read more
+Performs copy-assignment from source
. Read more
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
enabled: bool
certificate: PathBuf
private_key: PathBuf
Deserialize this value from the given Serde deserializer. Read more
+Mutably borrows from an owned value. Read more
+Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
+WithDispatch
wrapper. Read more
pub trait ApplySettings {
+ fn apply_settings<A>(self, settings: &BasicSettings<A>) -> Self
where
A: DeserializeOwned;
+}
Apply a BasicSettings
value to self
.
pub type Settings = BasicSettings<NoSettings>;
U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","Change max size of payload. By default max size is 256Kb","Change max size of payload. By default max size is 256Kb","Create ProtoBufMessage
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"],[4,"PayloadError"],[3,"DecodeError"],[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"]]},\
"actix_redis":{"doc":"Redis integration for actix
.","t":[12,13,13,3,13,13,4,13,13,13,13,13,13,13,3,13,13,4,4,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,11,11,14,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,12,12,12,12,12,12,12,12,12],"n":["0","Array","BulkString","Command","Connection","Disconnected","Error","Error","IO","Integer","Internal","Nil","NotConnected","Redis","RedisActor","Remote","Resp","RespError","RespValue","SimpleString","Unexpected","append","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","eq","equivalent","error","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_resp_int","handle","handle","into","into","into","into","into","ne","push","resp_array","restarting","source","source","start","started","to_owned","to_string","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","0","0","0","1","0","0","0","0","0"],"q":["actix_redis","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_redis::Error","actix_redis::RespError","","","","","","","actix_redis::RespValue","","","",""],"d":["","Zero, one or more other RespValue
s.","A bulk string. In Redis terminology a string is a …","Command for sending data to Redis.","Error creating a connection, or an error with a connection …","Cancel all waiters when connection is dropped.","General purpose actix-redis
error.","An error from the Redis server","An IO error occurred","Redis documentation defines an integer as being a signed …","A non-specific internal error that prevented an operation …","","Receiving message during reconnecting.","","Redis communication actor.","A remote error","A RESP parsing/serialising error occurred","","A single RESP value, this owns the data that is read/to-be …","","An unexpected error. In this context “unexpected” …","Convenience function for building dynamic Redis commands …","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","","","","","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","Push item to Resp array","Macro to create a RESP array, useful for preparing …","","","","Start new Supervisor
with RedisActor
.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[7,1,1,0,13,10,0,1,13,1,13,1,10,10,0,13,13,0,0,1,13,1,4,7,10,1,13,4,7,10,1,13,1,1,1,1,4,7,10,10,1,13,13,4,7,10,10,1,1,1,1,1,1,1,1,13,13,13,1,4,4,4,7,10,1,13,1,1,0,4,10,13,4,4,1,10,13,4,7,10,1,13,4,7,10,1,13,4,7,10,1,13,4,7,10,1,13,28,29,30,31,32,33,34,31,35,36,37,38,39],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2],1],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,1],[[]],[[1,1],3],[[],3],[[4,5],6],[[7,8],9],[[10,8],9],[[10,8],9],[[1,8],[[12,[11]]]],[[13,8],[[12,[11]]]],[[13,8],[[12,[11]]]],[[]],[[]],[13,10],[[]],[[],1],[[]],[14,1],[[[17,[15,16]]],1],[18,1],[14,1],[19,1],[[[20,[18]]],1],[[]],[21,13],[5,13],[1,[[12,[1,13]]]],[[4,[12,[1,13]]]],[[4,7]],[[]],[[]],[[]],[[]],[[]],[[1,1],3],[1],0,[4],[10,[[23,[22]]]],[13,[[23,[22]]]],[[[24,[14]]],[[25,[4]]]],[[4,26]],[[]],[[],14],[[],14],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],12],[[],27],[[],27],[[],27],[[],27],[[],27],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0],"p":[[4,"RespValue"],[8,"IntoIterator"],[15,"bool"],[3,"RedisActor"],[3,"Error"],[4,"Running"],[3,"Command"],[3,"Formatter"],[6,"Result"],[4,"Error"],[3,"Error"],[4,"Result"],[4,"RespError"],[3,"String"],[15,"u8"],[3,"Global"],[3,"Vec"],[15,"str"],[15,"usize"],[3,"Arc"],[3,"TrySendError"],[8,"Error"],[4,"Option"],[8,"Into"],[3,"Addr"],[3,"Context"],[3,"TypeId"],[13,"Redis"],[13,"Internal"],[13,"IO"],[13,"Resp"],[13,"Remote"],[13,"Connection"],[13,"Unexpected"],[13,"Array"],[13,"BulkString"],[13,"Error"],[13,"Integer"],[13,"SimpleString"]]},\
"actix_session":{"doc":"Session management for Actix Web.","t":[13,13,13,3,8,3,3,3,4,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,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,0,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,3,13,4,13,13,3,13,13,4,3,13,4,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,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,3,13,4,13,13,13,3,3,3,3,4,13,13,3,8,4,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,11,11,11,11,11,11,11,11,11,10,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,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12],"n":["Changed","Purged","Renewed","Session","SessionExt","SessionGetError","SessionInsertError","SessionMiddleware","SessionStatus","Unchanged","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builder","clear","clone","clone","clone","clone_into","clone_into","clone_into","config","default","entries","eq","equivalent","error_response","error_response","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from_request","get","get_session","insert","into","into","into","into","into","new","new_transform","purge","remove","remove_as","renew","source","source","status","storage","to_owned","to_owned","to_owned","to_string","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","BrowserSession","BrowserSession","CookieContentSecurity","OnEveryRequest","OnStateChanges","PersistentSession","PersistentSession","Private","SessionLifecycle","SessionMiddlewareBuilder","Signed","TtlExtensionPolicy","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cookie_content_security","cookie_domain","cookie_http_only","cookie_name","cookie_path","cookie_same_site","cookie_secure","default","default","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","into","into","into","into","into","into","session_lifecycle","session_ttl","session_ttl_extension_policy","state_ttl","state_ttl_extension_policy","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","0","0","CookieSessionStore","Deserialization","LoadError","Other","Other","Other","RedisActorSessionStore","RedisActorSessionStoreBuilder","RedisSessionStore","RedisSessionStoreBuilder","SaveError","Serialization","Serialization","SessionKey","SessionStore","UpdateError","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","builder","builder","cache_keygen","cache_keygen","clone","clone_into","default","delete","delete","delete","delete","eq","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","load","load","load","load","ne","new","new","save","save","save","save","source","source","source","to_owned","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update","update","update","update","update_ttl","update_ttl","update_ttl","update_ttl","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","0","0","0","0","0","0"],"q":["actix_session","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_session::config","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_session::config::SessionLifecycle","","actix_session::storage","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_session::storage::LoadError","","actix_session::storage::SaveError","","actix_session::storage::UpdateError",""],"d":["Session state has been updated - the changes will have to …","The session has been flagged for deletion - the session …","The session has been flagged for renewal.","The primary interface to access and modify session state.","Extract a Session
object from various actix-web
types …","Error returned by Session::get
.","Error returned by Session::insert
.","A middleware for session management in Actix Web …","Status of a Session
.","The session state has not been modified since its …","","","","","","","","","","","A fluent API to configure SessionMiddleware
.","Clear the session.","","","","","","","Configuration options to tune the behaviour of …","","Get all raw key-value data from the session.","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","Get a value
from the session.","Extract a Session
object.","Inserts a key-value pair into the session.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Use SessionMiddleware::new
to initialize the session …","","Removes session both client and server side.","Remove value from the session.","Remove value from the session and deserialize.","Renews the session key, assigning existing session state …","","","Returns session status.","Pluggable storage backends for session state.","","","","","","","","","","","","","","","","","","","","","","","","","","A session lifecycle strategy where the session cookie …","The session cookie will expire when the current browser …","Determines how to secure the content of the session cookie.","The TTL is refreshed every time the server receives a …","The TTL is refreshed every time the session state changes …","A session lifecycle strategy where the session cookie will …","The session cookie will be a persistent cookie.","The cookie content is encrypted when using …","Determines what type of session cookie should be used and …","A fluent builder to construct a SessionMiddleware
instance …","The cookie content is signed when using …","Configuration for which events should trigger an extension …","","","","","","","","","","","","","Finalise the builder and return a SessionMiddleware
…","","","","","","","","","","","Choose how the session cookie content should be secured.","Set the Domain
attribute for the cookie used to store the …","Set the HttpOnly
attribute for the cookie used to store …","Set the name of the cookie used to store the session ID.","Set the Path
attribute for the cookie used to store the …","Set the SameSite
attribute for the cookie used to store …","Set the Secure
attribute for the cookie used to store the …","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Determines what type of session cookie should be used and …","Specifies how long the session cookie should live.","Determines under what circumstances the TTL of your …","Sets a time-to-live (TTL) when storing the session state …","Determine under what circumstances the TTL of your session …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Use the session key, stored in the session cookie, as …","Failed to deserialize session state.","Possible failures modes for SessionStore::load
.","Something went wrong when retrieving the session state.","Something went wrong when persisting the session state.","Something went wrong when updating the session state.","Use Redis as session storage backend.","A fluent builder to construct a RedisActorSessionStore
…","Use Redis as session storage backend.","A fluent builder to construct a RedisSessionStore
instance …","Possible failures modes for SessionStore::save
.","Failed to serialize session state.","Failed to serialize session state.","A session key, the string stored in a client-side cookie …","The interface to retrieve and save the current session …","Possible failures modes for SessionStore::update
.","","","","","","","","","","","","","","","","","","","","Finalise the builder and return a RedisActorSessionStore
…","Finalise the builder and return a RedisActorSessionStore
…","A fluent API to configure RedisActorSessionStore
.","A fluent API to configure RedisSessionStore
. It takes as …","Set a custom cache key generation strategy, expecting a …","Set a custom cache key generation strategy, expecting a …","","","","Deletes a session from the store.","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Loads the session state associated to a session key.","","","","","Create a new instance of RedisActorSessionStore
using the …","Create a new instance of RedisSessionStore
using the …","Persist the session state for a newly created session.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Updates the session state associated to a pre-existing …","","","","Updates the TTL of the session state associated to a …","","","","","","","","","","","","","","","","","",""],"i":[7,7,7,0,0,0,0,0,0,7,6,4,7,12,15,6,4,7,12,15,6,4,6,4,7,6,4,7,0,7,4,7,7,12,15,7,12,12,15,15,6,4,7,12,12,15,15,4,4,48,4,6,4,7,12,15,6,6,4,4,4,4,12,15,4,0,6,4,7,12,15,6,4,7,12,15,6,4,7,12,15,6,4,7,12,15,6,4,7,12,15,0,29,0,32,32,0,29,33,0,0,33,0,3,29,30,31,32,33,3,29,30,31,32,33,3,29,30,31,32,33,29,30,31,32,33,3,3,3,3,3,3,3,30,31,29,30,31,32,33,3,29,29,29,30,31,32,33,3,29,30,31,32,33,3,31,31,30,30,29,30,31,32,33,3,29,30,31,32,33,3,29,30,31,32,33,3,29,30,31,32,33,3,29,30,31,32,33,49,50,0,45,0,45,46,47,0,0,0,0,0,46,47,0,0,0,36,38,37,39,45,46,47,36,42,41,38,37,39,45,46,47,36,42,41,37,39,38,41,37,39,41,41,42,1,38,42,41,36,36,45,45,46,46,47,47,36,38,37,39,45,46,47,36,42,41,38,37,39,45,46,47,36,42,41,1,38,42,41,36,38,41,1,38,42,41,45,46,47,41,45,46,47,38,37,39,45,46,47,36,36,42,41,38,37,39,45,46,47,36,42,41,38,37,39,45,46,47,36,42,41,1,38,42,41,1,38,42,41,38,37,39,45,46,47,36,42,41,51,52,53,54,55,56],"f":[0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[1,2],[[3,[1]]]],[4],[[[6,[[0,[5,1]]]]],[[6,[[0,[5,1]]]]]],[4,4],[7,7],[[]],[[]],[[]],0,[[],7],[4,[[10,[[9,[8,8]]]]]],[[7,7],11],[[],11],[12,[[14,[13]]]],[15,[[14,[13]]]],[[7,16],17],[[12,16],17],[[12,16],17],[[15,16],17],[[15,16],17],[[]],[[]],[[]],[18,12],[[]],[18,15],[[]],[[19,20]],[[4,21],[[24,[[23,[22]],12]]]],[[],4],[[4,[25,[8]],26],[[24,[15]]]],[[]],[[]],[[]],[[]],[[]],[[1,2],[[6,[1]]]],[6],[4],[[4,21],[[23,[8]]]],[[4,21],[[23,[[24,[22,8]]]]]],[4],[12,[[23,[27]]]],[15,[[23,[27]]]],[4,7],0,[[]],[[]],[[]],[[],8],[[],8],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],28],[[],28],[[],28],[[],28],[[],28],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[3,[1]]],[[6,[1]]]],[29,29],[30,30],[31,31],[32,32],[33,33],[[]],[[]],[[]],[[]],[[]],[[[3,[1]],33],[[3,[1]]]],[[[3,[1]],[23,[8]]],[[3,[1]]]],[[[3,[1]],11],[[3,[1]]]],[[[3,[1]],8],[[3,[1]]]],[[[3,[1]],8],[[3,[1]]]],[[[3,[1]],34],[[3,[1]]]],[[[3,[1]],11],[[3,[1]]]],[[],30],[[],31],[[29,16],17],[[30,16],17],[[31,16],17],[[32,16],17],[[33,16],17],[[]],[[]],[30,29],[31,29],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[3,[1]],[25,[29]]],[[3,[1]]]],[[31,35],31],[[31,32],31],[[30,35],30],[[30,32],30],[[]],[[]],[[]],[[]],[[]],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],28],[[],28],[[],28],[[],28],[[],28],[[],28],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[36,21],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[37,38],[39,40],[[[25,[8]]],37],[[[25,[8]]],39],[37,37],[39,39],[41,41],[[]],[[],42],[36,[[44,[[43,[40]]]]]],[[38,36],[[44,[[43,[40]]]]]],[[42,36],[[44,[[43,[40]]]]]],[[41,36],[[44,[[43,[40]]]]]],[[36,36],11],[[],11],[[45,16],17],[[45,16],17],[[46,16],17],[[46,16],17],[[47,16],17],[[47,16],17],[[36,16],17],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[36,[[44,[[43,[40]]]]]],[[38,36],[[44,[[43,[40]]]]]],[[42,36],[[44,[[43,[40]]]]]],[[41,36],[[44,[[43,[40]]]]]],[[36,36],11],[[[25,[8]]],38],[[[25,[8]]],40],[[[9,[8,8]],35],[[44,[[43,[40]]]]]],[[38,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[42,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[41,[9,[8,8]],35],[[44,[[43,[40]]]]]],[45,[[23,[27]]]],[46,[[23,[27]]]],[47,[[23,[27]]]],[[]],[[],8],[[],8],[[],8],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[8,[[24,[36]]]],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],24],[[],28],[[],28],[[],28],[[],28],[[],28],[[],28],[[],28],[[],28],[[],28],[[36,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[38,36,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[42,36,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[41,36,[9,[8,8]],35],[[44,[[43,[40]]]]]],[[36,35],[[44,[[43,[40]]]]]],[[38,36,35],[[44,[[43,[40]]]]]],[[42,36,35],[[44,[[43,[40]]]]]],[[41,36,35],[[44,[[43,[40]]]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0],"p":[[8,"SessionStore"],[3,"Key"],[3,"SessionMiddlewareBuilder"],[3,"Session"],[8,"Clone"],[3,"SessionMiddleware"],[4,"SessionStatus"],[3,"String"],[3,"HashMap"],[3,"Ref"],[15,"bool"],[3,"SessionGetError"],[3,"BoxBody"],[3,"HttpResponse"],[3,"SessionInsertError"],[3,"Formatter"],[6,"Result"],[3,"Error"],[3,"HttpRequest"],[4,"Payload"],[15,"str"],[8,"DeserializeOwned"],[4,"Option"],[4,"Result"],[8,"Into"],[8,"Serialize"],[8,"Error"],[3,"TypeId"],[4,"SessionLifecycle"],[3,"BrowserSession"],[3,"PersistentSession"],[4,"TtlExtensionPolicy"],[4,"CookieContentSecurity"],[4,"SameSite"],[3,"Duration"],[3,"SessionKey"],[3,"RedisActorSessionStoreBuilder"],[3,"RedisActorSessionStore"],[3,"RedisSessionStoreBuilder"],[8,"Future"],[3,"RedisSessionStore"],[3,"CookieSessionStore"],[3,"Box"],[3,"Pin"],[4,"LoadError"],[4,"SaveError"],[4,"UpdateError"],[8,"SessionExt"],[13,"BrowserSession"],[13,"PersistentSession"],[13,"Deserialization"],[13,"Other"],[13,"Serialization"],[13,"Other"],[13,"Serialization"],[13,"Other"]]},\
+"actix_settings":{"doc":"","t":[3,3,8,4,6,4,3,13,13,13,13,13,13,13,13,13,13,13,13,4,13,13,13,13,4,4,13,4,3,4,13,8,13,13,13,13,13,13,6,4,3,13,12,12,10,12,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,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,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,11,11,11,11,11,11,11,11,11,11,11,11,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,11,11,11,11,11,11,11,11,11,11,12,11,11,10,11,11,11,11,11,11,11,11,11,12,12,12,12,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,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12],"n":["ActixSettings","Address","ApplySettings","AtError","AtResult","Backlog","BasicSettings","Default","Default","Default","Default","Default","Default","Development","Disabled","EnvVarError","FileExists","InvalidValue","IoError","KeepAlive","Manual","Manual","Manual","Manual","MaxConnectionRate","MaxConnections","Milliseconds","Mode","NoSettings","NumWorkers","Os","Parse","ParseAddressError","ParseBoolError","ParseIntError","Production","Seconds","Seconds","Settings","Timeout","Tls","TomlError","actix","application","apply_settings","backlog","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","certificate","client_shutdown","client_timeout","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","deserialize","enable_compression","enable_log","enabled","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_default_template","from_template","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","get_hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","host","hosts","into","into","into","into","into","into","into","into","into","into","into","into","into","keep_alive","max_connection_rate","max_connections","mode","ne","ne","ne","ne","ne","ne","ne","ne","ne","ne","num_workers","override_field","override_field_with_env_var","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse_toml","port","private_key","shutdown_timeout","tls","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","write_toml_file","0","0","0","0","0","0","0","column","expected","file","got","line","0","0","0","0","0","0","0"],"q":["actix_settings","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_settings::AtError","","","","","","","","","","","","actix_settings::Backlog","actix_settings::KeepAlive","actix_settings::MaxConnectionRate","actix_settings::MaxConnections","actix_settings::NumWorkers","actix_settings::Timeout",""],"d":["Settings types for Actix Web.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Apply a BasicSettings
value to self
.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Parse an instance of Self
straight from the default TOML
…","Parse an instance of Self
straight from the default TOML
…","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","","","","","","","","","","","","","","","","","","","","","","","","","","Parse an instance of Self
from a TOML
file located at …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Write the default TOML
template to a new file, to be …","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,6,7,8,9,10,11,5,10,2,2,2,2,0,6,7,8,9,0,0,11,0,0,0,10,0,2,2,2,5,10,11,0,0,0,2,1,1,32,3,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,12,3,3,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,3,4,5,6,7,8,9,10,11,12,1,14,3,3,12,3,4,5,6,7,8,9,10,11,12,1,14,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,2,2,2,2,2,2,2,3,4,5,6,7,8,9,10,11,12,1,14,1,1,3,4,5,6,7,8,9,10,11,12,1,14,3,4,5,6,7,8,9,10,11,12,1,14,4,3,2,3,4,5,6,7,8,9,10,11,12,1,14,3,3,3,3,3,4,6,7,8,9,10,11,12,1,3,1,1,33,4,5,6,7,8,9,10,11,1,4,12,3,3,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,2,3,4,5,6,7,8,9,10,11,12,1,14,1,34,35,36,37,38,39,40,41,41,41,41,41,42,43,44,45,46,47,48],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1],0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10],[11,11],[12,12],[[[1,[13]]],[[1,[13]]]],[14,14],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[[15,[3]]]],[[],[[15,[4]]]],[[],[[15,[5]]]],[[],[[15,[6]]]],[[],[[15,[7]]]],[[],[[15,[8]]]],[[],[[15,[9]]]],[[],[[15,[10]]]],[[],[[15,[11]]]],[[],[[15,[12]]]],[[],[[15,[1]]]],[[],[[15,[14]]]],0,0,0,[[3,3],16],[[4,4],16],[[5,5],16],[[6,6],16],[[7,7],16],[[8,8],16],[[9,9],16],[[10,10],16],[[11,11],16],[[12,12],16],[[[1,[17]],1],16],[[14,14],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[2,18],19],[[3,18],19],[[4,18],19],[[5,18],19],[[6,18],19],[[7,18],19],[[8,18],19],[[9,18],19],[[10,18],19],[[11,18],19],[[12,18],19],[[[1,[20]],18],19],[[14,18],19],[[]],[21,2],[22,2],[23,2],[24,2],[25,2],[26,2],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[[27,[1]]]],[28,[[27,[1]]]],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[[],29],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[[[1,[30]]]],[14],0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,[[3,3],16],[[4,4],16],[[6,6],16],[[7,7],16],[[8,8],16],[[9,9],16],[[10,10],16],[[11,11],16],[[12,12],16],[[[1,[17]],1],16],0,[[],27],[[],27],[28,[[15,[2]]]],[28,[[15,[4,2]]]],[28,[[15,[5,2]]]],[28,[[15,[6,2]]]],[28,[[15,[7,2]]]],[28,[[15,[8,2]]]],[28,[[15,[9,2]]]],[28,[[15,[10,2]]]],[28,[[15,[11,2]]]],[[],[[27,[1]]]],0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[],31],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],27],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"p":[[3,"BasicSettings"],[4,"AtError"],[3,"ActixSettings"],[3,"Address"],[4,"Mode"],[4,"NumWorkers"],[4,"Backlog"],[4,"MaxConnections"],[4,"MaxConnectionRate"],[4,"KeepAlive"],[4,"Timeout"],[3,"Tls"],[8,"Clone"],[3,"NoSettings"],[4,"Result"],[15,"bool"],[8,"PartialEq"],[3,"Formatter"],[6,"Result"],[8,"Debug"],[3,"ParseBoolError"],[3,"ParseIntError"],[3,"Error"],[4,"VarError"],[3,"IoError"],[3,"Error"],[6,"AtResult"],[15,"str"],[15,"u64"],[8,"Hash"],[3,"TypeId"],[8,"ApplySettings"],[8,"Parse"],[13,"EnvVarError"],[13,"FileExists"],[13,"IoError"],[13,"ParseBoolError"],[13,"ParseIntError"],[13,"ParseAddressError"],[13,"TomlError"],[13,"InvalidValue"],[13,"Manual"],[13,"Seconds"],[13,"Manual"],[13,"Manual"],[13,"Manual"],[13,"Milliseconds"],[13,"Seconds"]]},\
"actix_web_httpauth":{"doc":"HTTP authentication schemes for Actix Web.","t":[0,0,0,8,3,16,0,0,11,11,11,11,11,11,11,11,11,10,11,11,11,11,11,11,11,11,11,11,11,3,3,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,3,3,4,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,11,11,11,11,11,11,11,0,0,3,13,3,3,13,13,13,4,8,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,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,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,8,3,0,0,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,3,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,3,3,4,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,3,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["extractors","headers","middleware","AuthExtractorConfig","AuthenticationError","Inner","basic","bearer","borrow","borrow_mut","challenge_mut","error_response","fmt","fmt","from","from","into","into_inner","new","status_code","status_code_mut","to_string","try_from","try_into","type_id","vzip","with_error","with_error_description","with_error_uri","BasicAuth","Config","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","default","fmt","fmt","from","from","from_request","into","into","into_inner","password","realm","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","user_id","vzip","vzip","BearerAuth","Config","Error","InsufficientScope","InvalidRequest","InvalidToken","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","cmp","default","eq","equivalent","fmt","fmt","fmt","fmt","from","from","from","from_request","get_hash","hash","into","into","into","into_inner","partial_cmp","realm","scope","status_code","to_owned","to_owned","to_owned","to_string","token","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","authorization","www_authenticate","Authorization","Base64DecodeError","Basic","Bearer","Invalid","MissingField","MissingScheme","ParseError","Scheme","ToStrError","Utf8Error","as_mut","as_ref","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","cmp","cmp","cmp","default","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","get_hash","hash","into","into","into","into","into_scheme","name","ne","ne","ne","new","new","parse","parse","parse","parse","partial_cmp","partial_cmp","partial_cmp","password","source","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","token","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into_pair","try_into_value","try_into_value","try_into_value","type_id","type_id","type_id","type_id","user_id","vzip","vzip","vzip","vzip","0","0","0","0","0","Challenge","WwwAuthenticate","basic","bearer","borrow","borrow_mut","clone","clone_into","cmp","default","eq","equivalent","fmt","from","get_hash","hash","into","name","ne","parse","partial_cmp","to_bytes","to_owned","try_from","try_into","try_into_pair","try_into_value","type_id","vzip","Basic","borrow","borrow_mut","clone","clone_into","cmp","default","eq","equivalent","fmt","fmt","from","get_hash","hash","into","ne","new","partial_cmp","to_owned","to_string","try_from","try_into","try_into_value","type_id","vzip","with_realm","Bearer","BearerBuilder","Error","InsufficientScope","InvalidRequest","InvalidToken","borrow","borrow","borrow_mut","borrow_mut","build","clone","clone_into","cmp","default","default","eq","equivalent","error","error_description","error_uri","finish","fmt","fmt","fmt","from","from","get_hash","hash","into","into","ne","partial_cmp","realm","scope","to_owned","to_string","try_from","try_from","try_into","try_into","try_into_value","type_id","type_id","vzip","vzip","HttpAuthentication","basic","bearer","borrow","borrow_mut","clone","clone_into","fmt","from","into","new_transform","to_owned","try_from","try_into","type_id","vzip","with_fn"],"q":["actix_web_httpauth","","","actix_web_httpauth::extractors","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors::basic","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::extractors::bearer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers","","actix_web_httpauth::headers::authorization","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::authorization::ParseError","","","","actix_web_httpauth::headers::www_authenticate","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::basic","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::headers::www_authenticate::bearer","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","actix_web_httpauth::middleware","","","","","","","","","","","","","","","",""],"d":["Type-safe authentication information extractors.","Typed HTTP headers.","HTTP Authentication middleware.","Trait implemented for types that provides configuration …","Authentication error returned by authentication extractors.","Associated challenge type.","Extractor for the “Basic” HTTP Authentication Scheme.","Extractor for the “Bearer” HTTP Authentication Scheme.","","","Returns mutable reference to the inner challenge instance.","","","","","Returns the argument unchanged.","Calls U::from(self)
.","Convert the config instance into a HTTP challenge.","Creates new authentication error from the provided …","","Returns mutable reference to the inner status code.","","","","","","Attach Error
to the current Authentication error.","Attach error description to the current Authentication …","Attach error URI to the current Authentication error.","Extractor for HTTP Basic auth.","BasicAuth
extractor configuration used for WWW-Authenticate
…","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Calls U::from(self)
.","Calls U::from(self)
.","","Returns client’s password.","Set challenge realm
attribute.","","","","","","","","","Returns client’s user-ID.","","","Extractor for HTTP Bearer auth","BearerAuth
extractor configuration.","Bearer authorization error types, described in RFC 6750.","The request requires higher privileges than provided by …","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","","Set challenge realm
attribute.","Set challenge scope
attribute.","Returns HTTP status code suitable for current error type.","","","","","Returns bearer token provided by client.","","","","","","","","","","","","","Authorization
header and various auth schemes.","WWW-Authenticate
header and various auth challenges.","Authorization
header, defined in RFC 7235","Malformed base64 string.","Credentials for Basic
authentication scheme, defined in …","Credentials for Bearer
authentication scheme, defined in …","Header value is malformed.","Required authentication field is missing.","Authentication scheme is missing.","Possible errors while parsing Authorization
header.","Authentication scheme for Authorization
header.","Unable to convert header into the str.","Malformed UTF-8 string.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Consumes Authorization
header and returns inner Scheme
…","","","","","Creates Basic
credentials with provided user_id
and …","Creates new Bearer
credentials with the token provided.","Try to parse an authentication scheme from the …","","","","","","","Returns client’s password if provided.","","","","","","","","","Gets reference to the credentials token.","","","","","","","","","","","","","","","","","Returns client’s user-ID.","","","","","","","","","","Authentication challenge for WWW-Authenticate
header.","WWW-Authenticate
header, described in RFC 7235.","Challenge for the “Basic” HTTP Authentication Scheme.","Challenge for the “Bearer” HTTP Authentication Scheme.","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self)
.","","","","","Converts the challenge into a bytes suitable for HTTP …","","","","","","","","Challenge for WWW-Authenticate
header with HTTP Basic auth …","","","","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self)
.","","Creates new Basic
challenge with an empty realm
field.","","","","","","","","","Creates new Basic
challenge from the provided realm
field …","Challenge for WWW-Authenticate
header with HTTP Bearer …","Builder for the Bearer
challenge.","Bearer authorization error types, described in RFC 6750.","The request requires higher privileges than provided by …","The request is missing a required parameter, includes an …","The access token provided is expired, revoked, malformed, …","","","","","Creates the builder for Bearer
challenge.","","","","","","","","Provides the error
attribute, as defined in [RFC 6750, …","Provides the error_description
attribute, as defined in […","Provides the error_uri
attribute, as defined in [RFC 6750 …","Consumes the builder and returns built Bearer
instance.","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","Calls U::from(self)
.","Calls U::from(self)
.","","","Provides the realm
attribute, as defined in RFC 2617.","Provides the scope
attribute, as defined in RFC 6749 §3.3.","","","","","","","","","","","","Middleware for checking HTTP authentication.","Construct HttpAuthentication
middleware for the HTTP “…","Construct HttpAuthentication
middleware for the HTTP “…","","","","","","Returns the argument unchanged.","Calls U::from(self)
.","","","","","","","Construct HttpAuthentication
middleware with the provided …"],"i":[0,0,0,0,0,51,0,0,2,2,2,2,2,2,2,2,2,51,2,2,2,2,2,2,2,2,2,2,2,0,0,13,13,15,13,15,13,15,13,15,13,13,15,13,15,15,13,15,13,15,13,13,15,13,15,13,15,13,15,15,13,15,0,0,0,12,12,12,20,20,21,12,20,21,12,20,21,12,20,21,12,12,20,12,12,20,21,12,12,20,21,12,21,12,12,20,21,12,20,12,20,20,12,20,21,12,12,21,20,21,12,20,21,12,20,21,12,20,21,12,0,0,0,35,0,0,35,35,35,0,0,35,35,28,28,35,28,30,31,35,28,30,31,28,30,31,28,30,31,28,30,31,28,28,30,31,28,30,31,35,35,28,28,30,30,31,31,35,35,35,35,28,28,28,30,31,28,28,35,28,30,31,28,28,28,30,31,30,31,27,28,30,31,28,30,31,30,35,28,30,31,35,28,30,31,31,35,28,30,31,35,28,30,31,28,28,30,31,35,28,30,31,30,35,28,30,31,52,53,54,55,46,0,0,0,0,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,1,46,46,46,46,46,46,46,0,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,0,0,0,12,12,12,49,11,49,11,11,11,11,11,49,11,11,11,49,49,49,49,49,11,11,49,11,11,11,49,11,11,11,49,49,11,11,49,11,49,11,11,49,11,49,11,0,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50],"f":[0,0,0,0,0,0,0,0,[[]],[[]],[[[2,[1]]]],[[[2,[1]]],3],[[[2,[1]],4],5],[[[2,[[0,[6,1]]]],4],5],[[],2],[[]],[[]],[[]],[1,[[2,[1]]]],[[[2,[1]]],7],[[[2,[1]]],7],[[],8],[[],9],[[],9],[[],10],[[]],[[[2,[11]],12],[[2,[11]]]],[[[2,[11]]],[[2,[11]]]],[[[2,[11]]],[[2,[11]]]],0,0,[13,14],[[]],[[]],[[]],[[]],[13,13],[15,15],[[]],[[]],[[],13],[[13,4],5],[[15,4],5],[[]],[[]],[[16,17]],[[]],[[]],[13],[15,[[19,[18]]]],[13,13],[[]],[[]],[[],9],[[],9],[[],9],[[],9],[[],10],[[],10],[15,18],[[]],[[]],0,0,0,0,0,0,[20,11],[[]],[[]],[[]],[[]],[[]],[[]],[20,20],[21,21],[12,12],[[]],[[]],[[]],[[12,12],22],[[],20],[[12,12],23],[[],23],[[20,4],5],[[21,4],5],[[12,4],5],[[12,4],5],[[]],[[]],[[]],[[16,17]],[[],24],[12],[[]],[[]],[[]],[20],[[12,12],[[19,[22]]]],[[20,[26,[[25,[18]]]]],20],[[20,[26,[[25,[18]]]]],20],[12,7],[[]],[[]],[[]],[[],8],[21,18],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],10],[[],10],[[],10],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[[28,[27]]]],[[[28,[27]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[28,[[0,[29,27]]]]],[[28,[[0,[29,27]]]]]],[30,30],[31,31],[[]],[[]],[[]],[[[28,[[0,[32,27]]]],28],22],[[30,30],22],[[31,31],22],[[],[[28,[[0,[33,27]]]]]],[[[28,[[0,[34,27]]]],28],23],[[30,30],23],[[31,31],23],[[],23],[[],23],[[],23],[[35,4],5],[[35,4],5],[[[28,[[0,[6,27]]]],4],5],[[[28,[27]],4],5],[[30,4],5],[[30,4],5],[[31,4],5],[[31,4],5],[36,35],[[]],[37,35],[38,35],[27,[[28,[27]]]],[39],[[]],[[]],[[]],[[],24],[[[28,[[0,[40,27]]]]]],[[]],[[]],[[]],[[]],[[[28,[27]]],27],[[],41],[[[28,[[0,[34,27]]]],28],23],[[30,30],23],[[31,31],23],[19,30],[[],31],[42,[[9,[35]]]],[[],[[9,[[28,[27]],43]]]],[42,[[9,[30,35]]]],[42,[[9,[31,35]]]],[[[28,[[0,[44,27]]]],28],[[19,[22]]]],[[30,30],[[19,[22]]]],[[31,31],[[19,[22]]]],[30,[[19,[18]]]],[35,[[19,[45]]]],[[]],[[]],[[]],[[],8],[[],8],[[],8],[[],8],[31,18],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[],9],[[[28,[27]]],[[9,[42]]]],[30,[[9,[42]]]],[31,[[9,[42]]]],[[],10],[[],10],[[],10],[[],10],[30,18],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,[[]],[[]],[[[46,[[0,[29,1]]]]],[[46,[[0,[29,1]]]]]],[[]],[[[46,[[0,[32,1]]]],46],22],[[],[[46,[[0,[33,1]]]]]],[[[46,[[0,[34,1]]]],46],23],[[],23],[[[46,[[0,[6,1]]]],4],5],[[]],[[],24],[[[46,[[0,[40,1]]]]]],[[]],[[],41],[[[46,[[0,[34,1]]]],46],23],[[],[[9,[[46,[1]],43]]]],[[[46,[[0,[44,1]]]],46],[[19,[22]]]],[[],47],[[]],[[],9],[[],9],[[],9],[[[46,[1]]],[[9,[42]]]],[[],10],[[]],0,[[]],[[]],[14,14],[[]],[[14,14],22],[[],14],[[14,14],23],[[],23],[[14,4],5],[[14,4],[[9,[48]]]],[[]],[[],24],[14],[[]],[[14,14],23],[[],14],[[14,14],[[19,[22]]]],[[]],[[],8],[[],9],[[],9],[14,[[9,[42]]]],[[],10],[[]],[[],14],0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],49],[11,11],[[]],[[11,11],22],[[],49],[[],11],[[11,11],23],[[],23],[[49,12],49],[49,49],[49,49],[49,11],[[49,4],5],[[11,4],5],[[11,4],[[9,[48]]]],[[]],[[]],[[],24],[11],[[]],[[]],[[11,11],23],[[11,11],[[19,[22]]]],[49,49],[49,49],[[]],[[],8],[[],9],[[],9],[[],9],[[],9],[11,[[9,[42]]]],[[],10],[[],10],[[]],[[]],0,[[],[[50,[15]]]],[[],[[50,[21]]]],[[]],[[]],[[[50,[29,29]]],[[50,[29,29]]]],[[]],[[[50,[6,6]],4],5],[[]],[[]],[50],[[]],[[],9],[[],9],[[],10],[[]],[[],50]],"p":[[8,"Challenge"],[3,"AuthenticationError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[8,"Debug"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"],[3,"Bearer"],[4,"Error"],[3,"Config"],[3,"Basic"],[3,"BasicAuth"],[3,"HttpRequest"],[4,"Payload"],[15,"str"],[4,"Option"],[3,"Config"],[3,"BearerAuth"],[4,"Ordering"],[15,"bool"],[15,"u64"],[4,"Cow"],[8,"Into"],[8,"Scheme"],[3,"Authorization"],[8,"Clone"],[3,"Basic"],[3,"Bearer"],[8,"Ord"],[8,"Default"],[8,"PartialEq"],[4,"ParseError"],[3,"ToStrError"],[4,"DecodeError"],[3,"Utf8Error"],[15,"never"],[8,"Hash"],[3,"HeaderName"],[3,"HeaderValue"],[4,"ParseError"],[8,"PartialOrd"],[8,"Error"],[3,"WwwAuthenticate"],[3,"Bytes"],[3,"Error"],[3,"BearerBuilder"],[3,"HttpAuthentication"],[8,"AuthExtractorConfig"],[13,"MissingField"],[13,"ToStrError"],[13,"Base64DecodeError"],[13,"Utf8Error"]]}\
}');
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
diff --git a/source-files.js b/source-files.js
index 46b9a27b4..aa0e66129 100644
--- a/source-files.js
+++ b/source-files.js
@@ -5,5 +5,6 @@ sourcesIndex["actix_limitation"] = {"name":"","files":["builder.rs","errors.rs",
sourcesIndex["actix_protobuf"] = {"name":"","files":["lib.rs"]};
sourcesIndex["actix_redis"] = {"name":"","files":["lib.rs","redis.rs"]};
sourcesIndex["actix_session"] = {"name":"","dirs":[{"name":"storage","files":["cookie.rs","interface.rs","mod.rs","redis_actor.rs","redis_rs.rs","session_key.rs","utils.rs"]}],"files":["config.rs","lib.rs","middleware.rs","session.rs","session_ext.rs"]};
+sourcesIndex["actix_settings"] = {"name":"","files":["actix.rs","core.rs","error.rs","lib.rs"]};
sourcesIndex["actix_web_httpauth"] = {"name":"","dirs":[{"name":"extractors","files":["basic.rs","bearer.rs","config.rs","errors.rs","mod.rs"]},{"name":"headers","dirs":[{"name":"authorization","dirs":[{"name":"scheme","files":["basic.rs","bearer.rs","mod.rs"]}],"files":["errors.rs","header.rs","mod.rs"]},{"name":"www_authenticate","dirs":[{"name":"challenge","dirs":[{"name":"bearer","files":["builder.rs","challenge.rs","errors.rs","mod.rs"]}],"files":["basic.rs","mod.rs"]}],"files":["header.rs","mod.rs"]}],"files":["mod.rs"]}],"files":["lib.rs","middleware.rs","utils.rs"]};
createSourceSidebar();
diff --git a/src/actix_settings/actix.rs.html b/src/actix_settings/actix.rs.html
new file mode 100644
index 000000000..1b3ced048
--- /dev/null
+++ b/src/actix_settings/actix.rs.html
@@ -0,0 +1,1026 @@
+1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +
use std::{fmt, path::PathBuf};
+
+use once_cell::sync::Lazy;
+use regex::Regex;
+use serde::{de, Deserialize};
+
+use crate::{core::Parse, error::AtError};
+
+/// Settings types for Actix Web.
+#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Hash)]
+#[serde(rename_all = "kebab-case")]
+pub struct ActixSettings {
+ pub hosts: Vec<Address>,
+ pub mode: Mode,
+ pub enable_compression: bool,
+ pub enable_log: bool,
+ pub num_workers: NumWorkers,
+ pub backlog: Backlog,
+ pub max_connections: MaxConnections,
+ pub max_connection_rate: MaxConnectionRate,
+ pub keep_alive: KeepAlive,
+ pub client_timeout: Timeout,
+ pub client_shutdown: Timeout,
+ pub shutdown_timeout: Timeout,
+ pub tls: Tls,
+}
+
+#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Hash)]
+pub struct Address {
+ pub host: String,
+ pub port: u16,
+}
+
+pub(crate) static ADDR_REGEX: Lazy<Regex> = Lazy::new(|| {
+ Regex::new(
+ r#"(?x)
+ \[ # opening square bracket
+ (\s)* # optional whitespace
+ "(?P<host>[^"]+)" # host name (string)
+ , # separating comma
+ (\s)* # optional whitespace
+ (?P<port>\d+) # port number (integer)
+ (\s)* # optional whitespace
+ \] # closing square bracket
+ "#,
+ )
+ .expect("Failed to compile regex: ADDR_REGEX")
+});
+
+pub(crate) static ADDR_LIST_REGEX: Lazy<Regex> = Lazy::new(|| {
+ Regex::new(
+ r#"(?x)
+ \[ # opening square bracket (list)
+ (\s)* # optional whitespace
+ (?P<elements>(
+ \[".*", (\s)* \d+\] # element
+ (,)? # element separator
+ (\s)* # optional whitespace
+ )*)
+ (\s)* # optional whitespace
+ \] # closing square bracket (list)
+ "#,
+ )
+ .expect("Failed to compile regex: ADDRS_REGEX")
+});
+
+impl Parse for Address {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ let mut items = string
+ .trim()
+ .trim_start_matches('[')
+ .trim_end_matches(']')
+ .split(',');
+
+ let parse_error = || AtError::ParseAddressError(string.to_string());
+
+ if !ADDR_REGEX.is_match(string) {
+ return Err(parse_error());
+ }
+
+ Ok(Self {
+ host: items.next().ok_or_else(parse_error)?.trim().to_string(),
+ port: items.next().ok_or_else(parse_error)?.trim().parse()?,
+ })
+ }
+}
+
+impl Parse for Vec<Address> {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ let parse_error = || AtError::ParseAddressError(string.to_string());
+
+ if !ADDR_LIST_REGEX.is_match(string) {
+ return Err(parse_error());
+ }
+
+ let mut addrs = vec![];
+
+ for list_caps in ADDR_LIST_REGEX.captures_iter(string) {
+ let elements = &list_caps["elements"].trim();
+ for elt_caps in ADDR_REGEX.captures_iter(elements) {
+ addrs.push(Address {
+ host: elt_caps["host"].to_string(),
+ port: elt_caps["port"].parse()?,
+ });
+ }
+ }
+
+ Ok(addrs)
+ }
+}
+
+#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Hash)]
+pub enum Mode {
+ #[serde(rename = "development")]
+ Development,
+
+ #[serde(rename = "production")]
+ Production,
+}
+
+impl Parse for Mode {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ match string {
+ "development" => Ok(Self::Development),
+ "production" => Ok(Self::Production),
+ _ => Err(InvalidValue! {
+ expected: "\"development\" | \"production\".",
+ got: string,
+ }),
+ }
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum NumWorkers {
+ Default,
+ Manual(usize),
+}
+
+impl Parse for NumWorkers {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ match string {
+ "default" => Ok(NumWorkers::Default),
+ string => match string.parse::<usize>() {
+ Ok(val) => Ok(NumWorkers::Manual(val)),
+ Err(_) => Err(InvalidValue! {
+ expected: "a positive integer",
+ got: string,
+ }),
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for NumWorkers {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct NumWorkersVisitor;
+
+ impl<'de> de::Visitor<'de> for NumWorkersVisitor {
+ type Value = NumWorkers;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\" or a string containing an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match NumWorkers::parse(value) {
+ Ok(num_workers) => Ok(num_workers),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(NumWorkersVisitor)
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum Backlog {
+ Default,
+ Manual(usize),
+}
+
+impl Parse for Backlog {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ match string {
+ "default" => Ok(Backlog::Default),
+ string => match string.parse::<usize>() {
+ Ok(val) => Ok(Backlog::Manual(val)),
+ Err(_) => Err(InvalidValue! {
+ expected: "an integer > 0",
+ got: string,
+ }),
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for Backlog {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct BacklogVisitor;
+
+ impl<'de> de::Visitor<'de> for BacklogVisitor {
+ type Value = Backlog;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\" or a string containing an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match Backlog::parse(value) {
+ Ok(backlog) => Ok(backlog),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(BacklogVisitor)
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum MaxConnections {
+ Default,
+ Manual(usize),
+}
+
+impl Parse for MaxConnections {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ match string {
+ "default" => Ok(MaxConnections::Default),
+ string => match string.parse::<usize>() {
+ Ok(val) => Ok(MaxConnections::Manual(val)),
+ Err(_) => Err(InvalidValue! {
+ expected: "an integer > 0",
+ got: string,
+ }),
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for MaxConnections {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct MaxConnectionsVisitor;
+
+ impl<'de> de::Visitor<'de> for MaxConnectionsVisitor {
+ type Value = MaxConnections;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\" or a string containing an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match MaxConnections::parse(value) {
+ Ok(max_connections) => Ok(max_connections),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(MaxConnectionsVisitor)
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum MaxConnectionRate {
+ Default,
+ Manual(usize),
+}
+
+impl Parse for MaxConnectionRate {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ match string {
+ "default" => Ok(MaxConnectionRate::Default),
+ string => match string.parse::<usize>() {
+ Ok(val) => Ok(MaxConnectionRate::Manual(val)),
+ Err(_) => Err(InvalidValue! {
+ expected: "an integer > 0",
+ got: string,
+ }),
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for MaxConnectionRate {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct MaxConnectionRateVisitor;
+
+ impl<'de> de::Visitor<'de> for MaxConnectionRateVisitor {
+ type Value = MaxConnectionRate;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\" or a string containing an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match MaxConnectionRate::parse(value) {
+ Ok(max_connection_rate) => Ok(max_connection_rate),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(MaxConnectionRateVisitor)
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum KeepAlive {
+ Default,
+ Disabled,
+ Os,
+ Seconds(usize),
+}
+
+impl Parse for KeepAlive {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ pub(crate) static FMT: Lazy<Regex> =
+ Lazy::new(|| Regex::new(r"^\d+ seconds$").expect("Failed to compile regex: FMT"));
+
+ pub(crate) static DIGITS: Lazy<Regex> =
+ Lazy::new(|| Regex::new(r"^\d+").expect("Failed to compile regex: FMT"));
+
+ macro_rules! invalid_value {
+ ($got:expr) => {
+ Err(InvalidValue! {
+ expected: "a string of the format \"N seconds\" where N is an integer > 0",
+ got: $got,
+ })
+ };
+ }
+
+ let digits_in = |m: regex::Match| &string[m.start()..m.end()];
+ match string {
+ "default" => Ok(KeepAlive::Default),
+ "disabled" => Ok(KeepAlive::Disabled),
+ "OS" | "os" => Ok(KeepAlive::Os),
+ string if !FMT.is_match(string) => invalid_value!(string),
+ string => match DIGITS.find(string) {
+ None => invalid_value!(string),
+ Some(mat) => match digits_in(mat).parse() {
+ Ok(val) => Ok(KeepAlive::Seconds(val)),
+ Err(_) => invalid_value!(string),
+ },
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for KeepAlive {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct KeepAliveVisitor;
+
+ impl<'de> de::Visitor<'de> for KeepAliveVisitor {
+ type Value = KeepAlive;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\", \"disabled\", \"os\", or a string of the format \"N seconds\" where N is an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match KeepAlive::parse(value) {
+ Ok(keep_alive) => Ok(keep_alive),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(KeepAliveVisitor)
+ }
+}
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum Timeout {
+ Default,
+ Milliseconds(usize),
+ Seconds(usize),
+}
+
+impl Parse for Timeout {
+ fn parse(string: &str) -> std::result::Result<Self, AtError> {
+ pub static FMT: Lazy<Regex> = Lazy::new(|| {
+ Regex::new(r"^\d+ (milliseconds|seconds)$").expect("Failed to compile regex: FMT")
+ });
+
+ pub static DIGITS: Lazy<Regex> =
+ Lazy::new(|| Regex::new(r"^\d+").expect("Failed to compile regex: DIGITS"));
+
+ pub static UNIT: Lazy<Regex> = Lazy::new(|| {
+ Regex::new(r"(milliseconds|seconds)$").expect("Failed to compile regex: UNIT")
+ });
+
+ macro_rules! invalid_value {
+ ($got:expr) => {
+ Err(InvalidValue! {
+ expected: "a string of the format \"N seconds\" or \"N milliseconds\" where N is an integer > 0",
+ got: $got,
+ })
+ }
+ }
+ match string {
+ "default" => Ok(Timeout::Default),
+ string if !FMT.is_match(string) => invalid_value!(string),
+ string => match (DIGITS.find(string), UNIT.find(string)) {
+ (None, _) => invalid_value!(string),
+ (_, None) => invalid_value!(string),
+ (Some(dmatch), Some(umatch)) => {
+ let digits = &string[dmatch.start()..dmatch.end()];
+ let unit = &string[umatch.start()..umatch.end()];
+ match (digits.parse(), unit) {
+ (Ok(v), "milliseconds") => Ok(Timeout::Milliseconds(v)),
+ (Ok(v), "seconds") => Ok(Timeout::Seconds(v)),
+ _ => invalid_value!(string),
+ }
+ }
+ },
+ }
+ }
+}
+
+impl<'de> serde::Deserialize<'de> for Timeout {
+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+ where
+ D: serde::Deserializer<'de>,
+ {
+ struct TimeoutVisitor;
+
+ impl<'de> de::Visitor<'de> for TimeoutVisitor {
+ type Value = Timeout;
+
+ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ let msg = "Either \"default\", \"disabled\", \"os\", or a string of the format \"N seconds\" where N is an integer > 0";
+ formatter.write_str(msg)
+ }
+
+ fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+ where
+ E: de::Error,
+ {
+ match Timeout::parse(value) {
+ Ok(num_workers) => Ok(num_workers),
+ Err(AtError::InvalidValue { expected, got, .. }) => Err(
+ de::Error::invalid_value(de::Unexpected::Str(&got), &expected),
+ ),
+ Err(_) => unreachable!(),
+ }
+ }
+ }
+
+ deserializer.deserialize_string(TimeoutVisitor)
+ }
+}
+
+#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Hash)]
+#[serde(rename_all = "kebab-case")]
+pub struct Tls {
+ pub enabled: bool,
+ pub certificate: PathBuf,
+ pub private_key: PathBuf,
+}
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +
use std::{path::PathBuf, str::FromStr};
+
+use crate::error::AtError;
+
+pub trait Parse: Sized {
+ fn parse(string: &str) -> Result<Self, AtError>;
+}
+
+impl Parse for bool {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ Self::from_str(string).map_err(AtError::from)
+ }
+}
+
+macro_rules! impl_parse_for_int_type {
+ ($($int_type:ty),+ $(,)?) => {
+ $(
+ impl Parse for $int_type {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ Self::from_str(string).map_err(AtError::from)
+ }
+ }
+ )+
+ }
+}
+impl_parse_for_int_type![i8, i16, i32, i64, i128, u8, u16, u32, u64, u128];
+
+impl Parse for String {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ Ok(string.to_string())
+ }
+}
+
+impl Parse for PathBuf {
+ fn parse(string: &str) -> Result<Self, AtError> {
+ Ok(PathBuf::from(string))
+ }
+}
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +
use std::{env::VarError, io, num::ParseIntError, path::PathBuf, str::ParseBoolError};
+
+use toml::de::Error as TomlError;
+
+pub type AtResult<T> = std::result::Result<T, AtError>;
+
+#[derive(Clone, Debug)]
+pub enum AtError {
+ EnvVarError(VarError),
+ FileExists(PathBuf),
+ InvalidValue {
+ expected: &'static str,
+ got: String,
+ file: &'static str,
+ line: u32,
+ column: u32,
+ },
+ IoError(ioe::IoError),
+ ParseBoolError(ParseBoolError),
+ ParseIntError(ParseIntError),
+ ParseAddressError(String),
+ TomlError(TomlError),
+}
+
+macro_rules! InvalidValue {
+ (expected: $expected:expr, got: $got:expr,) => {
+ crate::AtError::InvalidValue {
+ expected: $expected,
+ got: $got.to_string(),
+ file: file!(),
+ line: line!(),
+ column: column!(),
+ }
+ };
+}
+
+impl From<io::Error> for AtError {
+ fn from(err: io::Error) -> Self {
+ Self::IoError(ioe::IoError::from(err))
+ }
+}
+
+impl From<ioe::IoError> for AtError {
+ fn from(err: ioe::IoError) -> Self {
+ Self::IoError(err)
+ }
+}
+
+impl From<ParseBoolError> for AtError {
+ fn from(err: ParseBoolError) -> Self {
+ Self::ParseBoolError(err)
+ }
+}
+
+impl From<ParseIntError> for AtError {
+ fn from(err: ParseIntError) -> Self {
+ Self::ParseIntError(err)
+ }
+}
+
+impl From<TomlError> for AtError {
+ fn from(err: TomlError) -> Self {
+ Self::TomlError(err)
+ }
+}
+
+impl From<VarError> for AtError {
+ fn from(err: VarError) -> Self {
+ Self::EnvVarError(err)
+ }
+}
+
+impl From<AtError> for io::Error {
+ fn from(err: AtError) -> Self {
+ match err {
+ AtError::EnvVarError(var_error) => {
+ let msg = format!("Env var error: {}", var_error);
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+
+ AtError::FileExists(path_buf) => {
+ let msg = format!("File exists: {}", path_buf.display());
+ io::Error::new(io::ErrorKind::AlreadyExists, msg)
+ }
+
+ AtError::InvalidValue {
+ expected,
+ ref got,
+ file,
+ line,
+ column,
+ } => {
+ let msg = format!(
+ "Expected {}, got {} (@ {}:{}:{})",
+ expected, got, file, line, column
+ );
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+
+ AtError::IoError(io_error) => io_error.into(),
+
+ AtError::ParseBoolError(parse_bool_error) => {
+ let msg = format!("Failed to parse boolean: {}", parse_bool_error);
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+
+ AtError::ParseIntError(parse_int_error) => {
+ let msg = format!("Failed to parse integer: {}", parse_int_error);
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+
+ AtError::ParseAddressError(string) => {
+ let msg = format!("Failed to parse address: {}", string);
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+
+ AtError::TomlError(toml_error) => {
+ let msg = format!("TOML error: {}", toml_error);
+ io::Error::new(io::ErrorKind::InvalidInput, msg)
+ }
+ }
+ }
+}
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +
/// A library to process Server.toml files
+use std::{
+ env, fmt,
+ fs::File,
+ io::{Read as _, Write as _},
+ path::Path,
+ time::Duration,
+};
+
+use actix_http::{Request, Response};
+use actix_service::IntoServiceFactory;
+use actix_web::{
+ body::MessageBody,
+ dev::{AppConfig, ServiceFactory},
+ http::KeepAlive as ActixKeepAlive,
+ Error as WebError, HttpServer,
+};
+use serde::{de, Deserialize};
+
+#[macro_use]
+mod error;
+mod actix;
+mod core;
+
+pub use self::actix::*;
+pub use self::core::Parse;
+pub use self::error::{AtError, AtResult};
+
+#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Hash)]
+#[serde(bound = "A: Deserialize<'de>")]
+pub struct BasicSettings<A> {
+ pub actix: ActixSettings,
+ pub application: A,
+}
+
+pub type Settings = BasicSettings<NoSettings>;
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)]
+#[non_exhaustive]
+pub struct NoSettings {/* NOTE: turning this into a unit struct will cause deserialization failures. */}
+
+impl<A> BasicSettings<A>
+where
+ A: de::DeserializeOwned,
+{
+ /// NOTE **DO NOT** mess with the ordering of the tables in this template.
+ /// Especially the `[application]` table needs to be last in order
+ /// for some tests to keep working.
+ pub(crate) const DEFAULT_TOML_TEMPLATE: &'static str = include_str!("./defaults.toml");
+
+ /// Parse an instance of `Self` from a `TOML` file located at `filepath`.
+ /// If the file doesn't exist, it is generated from the default `TOML`
+ /// template, after which the newly generated file is read in and parsed.
+ pub fn parse_toml<P>(filepath: P) -> AtResult<Self>
+ where
+ P: AsRef<Path>,
+ {
+ let filepath = filepath.as_ref();
+
+ if !filepath.exists() {
+ Self::write_toml_file(filepath)?;
+ }
+
+ let mut f = File::open(filepath)?;
+ let mut contents = String::with_capacity(f.metadata()?.len() as usize);
+ f.read_to_string(&mut contents)?;
+
+ Ok(toml::from_str::<Self>(&contents)?)
+ }
+
+ /// Parse an instance of `Self` straight from the default `TOML` template.
+ pub fn from_default_template() -> AtResult<Self> {
+ Self::from_template(Self::DEFAULT_TOML_TEMPLATE)
+ }
+
+ /// Parse an instance of `Self` straight from the default `TOML` template.
+ pub fn from_template(template: &str) -> AtResult<Self> {
+ Ok(toml::from_str(template)?)
+ }
+
+ /// Write the default `TOML` template to a new file, to be located
+ /// at `filepath`. Return a `Error::FileExists(_)` error if a
+ /// file already exists at that location.
+ pub fn write_toml_file<P>(filepath: P) -> AtResult<()>
+ where
+ P: AsRef<Path>,
+ {
+ let filepath = filepath.as_ref();
+ let contents = Self::DEFAULT_TOML_TEMPLATE.trim();
+
+ if filepath.exists() {
+ return Err(AtError::FileExists(filepath.to_path_buf()));
+ }
+
+ let mut file = File::create(filepath)?;
+ file.write_all(contents.as_bytes())?;
+ file.flush()?;
+
+ Ok(())
+ }
+
+ pub fn override_field<F, V>(field: &mut F, value: V) -> AtResult<()>
+ where
+ F: Parse,
+ V: AsRef<str>,
+ {
+ *field = F::parse(value.as_ref())?;
+ Ok(())
+ }
+
+ pub fn override_field_with_env_var<F, N>(field: &mut F, var_name: N) -> AtResult<()>
+ where
+ F: Parse,
+ N: AsRef<str>,
+ {
+ match env::var(var_name.as_ref()) {
+ Err(env::VarError::NotPresent) => Ok((/*NOP*/)),
+ Err(var_error) => Err(AtError::from(var_error)),
+ Ok(value) => Self::override_field(field, value),
+ }
+ }
+}
+
+pub trait ApplySettings {
+ /// Apply a [`BasicSettings`] value to `self`.
+ ///
+ /// [`BasicSettings`]: ./struct.BasicSettings.html
+ #[must_use]
+ fn apply_settings<A>(self, settings: &BasicSettings<A>) -> Self
+ where
+ A: de::DeserializeOwned;
+}
+
+impl<F, I, S, B> ApplySettings for HttpServer<F, I, S, B>
+where
+ F: Fn() -> I + Send + Clone + 'static,
+ I: IntoServiceFactory<S, Request>,
+ S: ServiceFactory<Request, Config = AppConfig> + 'static,
+ S::Error: Into<WebError> + 'static,
+ S::InitError: fmt::Debug,
+ S::Response: Into<Response<B>> + 'static,
+ S::Future: 'static,
+ B: MessageBody + 'static,
+{
+ fn apply_settings<A>(mut self, settings: &BasicSettings<A>) -> Self
+ where
+ A: de::DeserializeOwned,
+ {
+ if settings.actix.tls.enabled {
+ // for Address { host, port } in &settings.actix.hosts {
+ // self = self.bind(format!("{}:{}", host, port))
+ // .unwrap(/*TODO*/);
+ // }
+ todo!("[ApplySettings] TLS support has not been implemented yet.");
+ } else {
+ for Address { host, port } in &settings.actix.hosts {
+ self = self.bind(format!("{}:{}", host, port))
+ .unwrap(/*TODO*/);
+ }
+ }
+
+ self = match settings.actix.num_workers {
+ NumWorkers::Default => self,
+ NumWorkers::Manual(n) => self.workers(n),
+ };
+
+ self = match settings.actix.backlog {
+ Backlog::Default => self,
+ Backlog::Manual(n) => self.backlog(n as u32),
+ };
+
+ self = match settings.actix.max_connections {
+ MaxConnections::Default => self,
+ MaxConnections::Manual(n) => self.max_connections(n),
+ };
+
+ self = match settings.actix.max_connection_rate {
+ MaxConnectionRate::Default => self,
+ MaxConnectionRate::Manual(n) => self.max_connection_rate(n),
+ };
+
+ self = match settings.actix.keep_alive {
+ KeepAlive::Default => self,
+ KeepAlive::Disabled => self.keep_alive(ActixKeepAlive::Disabled),
+ KeepAlive::Os => self.keep_alive(ActixKeepAlive::Os),
+ KeepAlive::Seconds(n) => self.keep_alive(Duration::from_secs(n as u64)),
+ };
+
+ self = match settings.actix.client_timeout {
+ Timeout::Default => self,
+ Timeout::Milliseconds(n) => {
+ self.client_disconnect_timeout(Duration::from_millis(n as u64))
+ }
+ Timeout::Seconds(n) => self.client_disconnect_timeout(Duration::from_secs(n as u64)),
+ };
+
+ self = match settings.actix.client_shutdown {
+ Timeout::Default => self,
+ Timeout::Milliseconds(n) => {
+ self.client_disconnect_timeout(Duration::from_millis(n as u64))
+ }
+ Timeout::Seconds(n) => self.client_disconnect_timeout(Duration::from_secs(n as u64)),
+ };
+
+ self = match settings.actix.shutdown_timeout {
+ Timeout::Default => self,
+ Timeout::Milliseconds(_) => self.shutdown_timeout(1),
+ Timeout::Seconds(n) => self.shutdown_timeout(n as u64),
+ };
+
+ self
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ #![allow(non_snake_case)]
+
+ use std::path::Path;
+
+ use actix_web::{App, HttpServer};
+ use serde::Deserialize;
+
+ use crate::actix::*; // used for value construction in assertions
+ use crate::{ApplySettings, AtResult, BasicSettings, Settings};
+
+ #[test]
+ fn apply_settings() -> AtResult<()> {
+ let settings = Settings::parse_toml("Server.toml")?;
+ let _ = HttpServer::new(App::new).apply_settings(&settings);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__hosts() {
+ let mut settings = Settings::from_default_template().unwrap();
+
+ assert_eq!(
+ settings.actix.hosts,
+ vec![Address {
+ host: "0.0.0.0".into(),
+ port: 9000
+ },]
+ );
+
+ Settings::override_field(
+ &mut settings.actix.hosts,
+ r#"[
+ ["0.0.0.0", 1234],
+ ["localhost", 2345]
+ ]"#,
+ )
+ .unwrap();
+
+ assert_eq!(
+ settings.actix.hosts,
+ vec![
+ Address {
+ host: "0.0.0.0".into(),
+ port: 1234
+ },
+ Address {
+ host: "localhost".into(),
+ port: 2345
+ },
+ ]
+ );
+ }
+
+ #[test]
+ fn override_field_with_env_var__hosts() {
+ let mut settings = Settings::from_default_template().unwrap();
+
+ assert_eq!(
+ settings.actix.hosts,
+ vec![Address {
+ host: "0.0.0.0".into(),
+ port: 9000
+ },]
+ );
+
+ std::env::set_var(
+ "OVERRIDE__HOSTS",
+ r#"[
+ ["0.0.0.0", 1234],
+ ["localhost", 2345]
+ ]"#,
+ );
+
+ Settings::override_field_with_env_var(&mut settings.actix.hosts, "OVERRIDE__HOSTS")
+ .unwrap();
+
+ assert_eq!(
+ settings.actix.hosts,
+ vec![
+ Address {
+ host: "0.0.0.0".into(),
+ port: 1234
+ },
+ Address {
+ host: "localhost".into(),
+ port: 2345
+ },
+ ]
+ );
+ }
+
+ #[test]
+ fn override_field__mode() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.mode, Mode::Development);
+ Settings::override_field(&mut settings.actix.mode, "production")?;
+ assert_eq!(settings.actix.mode, Mode::Production);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__mode() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.mode, Mode::Development);
+ std::env::set_var("OVERRIDE__MODE", "production");
+ Settings::override_field_with_env_var(&mut settings.actix.mode, "OVERRIDE__MODE")?;
+ assert_eq!(settings.actix.mode, Mode::Production);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__enable_compression() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(settings.actix.enable_compression);
+ Settings::override_field(&mut settings.actix.enable_compression, "false")?;
+ assert!(!settings.actix.enable_compression);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__enable_compression() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(settings.actix.enable_compression);
+ std::env::set_var("OVERRIDE__ENABLE_COMPRESSION", "false");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.enable_compression,
+ "OVERRIDE__ENABLE_COMPRESSION",
+ )?;
+ assert!(!settings.actix.enable_compression);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__enable_log() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(settings.actix.enable_log);
+ Settings::override_field(&mut settings.actix.enable_log, "false")?;
+ assert!(!settings.actix.enable_log);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__enable_log() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(settings.actix.enable_log);
+ std::env::set_var("OVERRIDE__ENABLE_LOG", "false");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.enable_log,
+ "OVERRIDE__ENABLE_LOG",
+ )?;
+ assert!(!settings.actix.enable_log);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__num_workers() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.num_workers, NumWorkers::Default);
+ Settings::override_field(&mut settings.actix.num_workers, "42")?;
+ assert_eq!(settings.actix.num_workers, NumWorkers::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__num_workers() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.num_workers, NumWorkers::Default);
+ std::env::set_var("OVERRIDE__NUM_WORKERS", "42");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.num_workers,
+ "OVERRIDE__NUM_WORKERS",
+ )?;
+ assert_eq!(settings.actix.num_workers, NumWorkers::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__backlog() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.backlog, Backlog::Default);
+ Settings::override_field(&mut settings.actix.backlog, "42")?;
+ assert_eq!(settings.actix.backlog, Backlog::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__backlog() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.backlog, Backlog::Default);
+ std::env::set_var("OVERRIDE__BACKLOG", "42");
+ Settings::override_field_with_env_var(&mut settings.actix.backlog, "OVERRIDE__BACKLOG")?;
+ assert_eq!(settings.actix.backlog, Backlog::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__max_connections() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.max_connections, MaxConnections::Default);
+ Settings::override_field(&mut settings.actix.max_connections, "42")?;
+ assert_eq!(settings.actix.max_connections, MaxConnections::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__max_connections() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.max_connections, MaxConnections::Default);
+ std::env::set_var("OVERRIDE__MAX_CONNECTIONS", "42");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.max_connections,
+ "OVERRIDE__MAX_CONNECTIONS",
+ )?;
+ assert_eq!(settings.actix.max_connections, MaxConnections::Manual(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__max_connection_rate() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.max_connection_rate,
+ MaxConnectionRate::Default
+ );
+ Settings::override_field(&mut settings.actix.max_connection_rate, "42")?;
+ assert_eq!(
+ settings.actix.max_connection_rate,
+ MaxConnectionRate::Manual(42)
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__max_connection_rate() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.max_connection_rate,
+ MaxConnectionRate::Default
+ );
+ std::env::set_var("OVERRIDE__MAX_CONNECTION_RATE", "42");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.max_connection_rate,
+ "OVERRIDE__MAX_CONNECTION_RATE",
+ )?;
+ assert_eq!(
+ settings.actix.max_connection_rate,
+ MaxConnectionRate::Manual(42)
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__keep_alive() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.keep_alive, KeepAlive::Default);
+ Settings::override_field(&mut settings.actix.keep_alive, "42 seconds")?;
+ assert_eq!(settings.actix.keep_alive, KeepAlive::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__keep_alive() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.keep_alive, KeepAlive::Default);
+ std::env::set_var("OVERRIDE__KEEP_ALIVE", "42 seconds");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.keep_alive,
+ "OVERRIDE__KEEP_ALIVE",
+ )?;
+ assert_eq!(settings.actix.keep_alive, KeepAlive::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__client_timeout() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.client_timeout, Timeout::Default);
+ Settings::override_field(&mut settings.actix.client_timeout, "42 seconds")?;
+ assert_eq!(settings.actix.client_timeout, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__client_timeout() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.client_timeout, Timeout::Default);
+ std::env::set_var("OVERRIDE__CLIENT_TIMEOUT", "42 seconds");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.client_timeout,
+ "OVERRIDE__CLIENT_TIMEOUT",
+ )?;
+ assert_eq!(settings.actix.client_timeout, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__client_shutdown() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.client_shutdown, Timeout::Default);
+ Settings::override_field(&mut settings.actix.client_shutdown, "42 seconds")?;
+ assert_eq!(settings.actix.client_shutdown, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__client_shutdown() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.client_shutdown, Timeout::Default);
+ std::env::set_var("OVERRIDE__CLIENT_SHUTDOWN", "42 seconds");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.client_shutdown,
+ "OVERRIDE__CLIENT_SHUTDOWN",
+ )?;
+ assert_eq!(settings.actix.client_shutdown, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__shutdown_timeout() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.shutdown_timeout, Timeout::Default);
+ Settings::override_field(&mut settings.actix.shutdown_timeout, "42 seconds")?;
+ assert_eq!(settings.actix.shutdown_timeout, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__shutdown_timeout() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(settings.actix.shutdown_timeout, Timeout::Default);
+ std::env::set_var("OVERRIDE__SHUTDOWN_TIMEOUT", "42 seconds");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.shutdown_timeout,
+ "OVERRIDE__SHUTDOWN_TIMEOUT",
+ )?;
+ assert_eq!(settings.actix.shutdown_timeout, Timeout::Seconds(42));
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__tls__enabled() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(!settings.actix.tls.enabled);
+ Settings::override_field(&mut settings.actix.tls.enabled, "true")?;
+ assert!(settings.actix.tls.enabled);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__tls__enabled() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert!(!settings.actix.tls.enabled);
+ std::env::set_var("OVERRIDE__TLS_ENABLED", "true");
+ Settings::override_field_with_env_var(
+ &mut settings.actix.tls.enabled,
+ "OVERRIDE__TLS_ENABLED",
+ )?;
+ assert!(settings.actix.tls.enabled);
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__tls__certificate() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.tls.certificate,
+ Path::new("path/to/cert/cert.pem")
+ );
+ Settings::override_field(
+ &mut settings.actix.tls.certificate,
+ "/overridden/path/to/cert/cert.pem",
+ )?;
+ assert_eq!(
+ settings.actix.tls.certificate,
+ Path::new("/overridden/path/to/cert/cert.pem")
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__tls__certificate() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.tls.certificate,
+ Path::new("path/to/cert/cert.pem")
+ );
+ std::env::set_var(
+ "OVERRIDE__TLS_CERTIFICATE",
+ "/overridden/path/to/cert/cert.pem",
+ );
+ Settings::override_field_with_env_var(
+ &mut settings.actix.tls.certificate,
+ "OVERRIDE__TLS_CERTIFICATE",
+ )?;
+ assert_eq!(
+ settings.actix.tls.certificate,
+ Path::new("/overridden/path/to/cert/cert.pem")
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_field__tls__private_key() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.tls.private_key,
+ Path::new("path/to/cert/key.pem")
+ );
+ Settings::override_field(
+ &mut settings.actix.tls.private_key,
+ "/overridden/path/to/cert/key.pem",
+ )?;
+ assert_eq!(
+ settings.actix.tls.private_key,
+ Path::new("/overridden/path/to/cert/key.pem")
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_field_with_env_var__tls__private_key() -> AtResult<()> {
+ let mut settings = Settings::from_default_template()?;
+ assert_eq!(
+ settings.actix.tls.private_key,
+ Path::new("path/to/cert/key.pem")
+ );
+ std::env::set_var(
+ "OVERRIDE__TLS_PRIVATE_KEY",
+ "/overridden/path/to/cert/key.pem",
+ );
+ Settings::override_field_with_env_var(
+ &mut settings.actix.tls.private_key,
+ "OVERRIDE__TLS_PRIVATE_KEY",
+ )?;
+ assert_eq!(
+ settings.actix.tls.private_key,
+ Path::new("/overridden/path/to/cert/key.pem")
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn override_extended_field_with_custom_type() -> AtResult<()> {
+ #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
+ struct NestedSetting {
+ foo: String,
+ bar: bool,
+ }
+ #[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
+ struct AppSettings {
+ #[serde(rename = "example-name")]
+ example_name: String,
+ #[serde(rename = "nested-field")]
+ nested_field: NestedSetting,
+ }
+ type CustomSettings = BasicSettings<AppSettings>;
+ let mut settings = CustomSettings::from_template(
+ &(CustomSettings::DEFAULT_TOML_TEMPLATE.to_string()
+ // NOTE: Add these entries to the `[application]` table:
+ + "\nexample-name = \"example value\""
+ + "\nnested-field = { foo = \"foo\", bar = false }"),
+ )?;
+ assert_eq!(
+ settings.application,
+ AppSettings {
+ example_name: "example value".into(),
+ nested_field: NestedSetting {
+ foo: "foo".into(),
+ bar: false,
+ },
+ }
+ );
+ CustomSettings::override_field(
+ &mut settings.application.example_name,
+ "/overridden/path/to/cert/key.pem",
+ )?;
+ assert_eq!(
+ settings.application,
+ AppSettings {
+ example_name: "/overridden/path/to/cert/key.pem".into(),
+ nested_field: NestedSetting {
+ foo: "foo".into(),
+ bar: false,
+ },
+ }
+ );
+ Ok(())
+ }
+}
+