pub struct WebAppConfig { /* private fields */ }Expand description
Application configuration
Implementations§
Source§impl WebAppConfig
impl WebAppConfig
Sourcepub fn with(name: &str, secure: bool, addr: SocketAddr, host: String) -> Self
pub fn with(name: &str, secure: bool, addr: SocketAddr, host: String) -> Self
Create an WebAppConfig instance.
Sourcepub fn name(&self) -> &ByteString
pub fn name(&self) -> &ByteString
Server name
Sourcepub fn host(&self) -> &str
pub fn host(&self) -> &str
Server host name
Host name is used by application router as a hostname for url generation.
Check ConnectionInfo::host()
documentation for more information.
By default host name is set to a “localhost:8080” value.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Returns the socket address of the local half of this TCP connection
Sourcepub fn state<T: 'static>(&self) -> Option<&T>
pub fn state<T: 'static>(&self) -> Option<&T>
Get an application state object stored with .set_state() method.
Sourcepub fn set_host(self, host: String) -> Self
pub fn set_host(self, host: String) -> Self
Set server host name.
By default host name is set to a “localhost:8080” value.
Sourcepub fn set_secure(self) -> Self
pub fn set_secure(self) -> Self
Connection is secure(https).
Sourcepub fn set_local_addr(self, addr: SocketAddr) -> Self
pub fn set_local_addr(self, addr: SocketAddr) -> Self
Set the socket address of the local half of the TCP connection.
Sourcepub fn set_pool_size(self, size: usize) -> Self
pub fn set_pool_size(self, size: usize) -> Self
Set size of HttpRequest pool size.
By default pool size is 128.
Trait Implementations§
Source§impl Configuration for WebAppConfig
impl Configuration for WebAppConfig
Source§impl Debug for WebAppConfig
impl Debug for WebAppConfig
Auto Trait Implementations§
impl !RefUnwindSafe for WebAppConfig
impl !UnwindSafe for WebAppConfig
impl Freeze for WebAppConfig
impl Send for WebAppConfig
impl Sync for WebAppConfig
impl Unpin for WebAppConfig
impl UnsafeUnpin for WebAppConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more