pub struct HttpServerConfig {
pub bind_addr: SocketAddr,
pub cors_enabled: bool,
pub timeout_secs: u64,
}Expand description
HTTP server configuration
Fields§
§bind_addr: SocketAddrBind address
cors_enabled: boolEnable CORS
timeout_secs: u64Request timeout in seconds
Implementations§
Source§impl HttpServerConfig
impl HttpServerConfig
Sourcepub fn with_addr(self, addr: SocketAddr) -> Self
pub fn with_addr(self, addr: SocketAddr) -> Self
Create with custom bind address
Sourcepub fn with_addr_str(self, addr: &str) -> Result<Self>
pub fn with_addr_str(self, addr: &str) -> Result<Self>
Parse from string address
Trait Implementations§
Source§impl Clone for HttpServerConfig
impl Clone for HttpServerConfig
Source§fn clone(&self) -> HttpServerConfig
fn clone(&self) -> HttpServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpServerConfig
impl Debug for HttpServerConfig
Auto Trait Implementations§
impl Freeze for HttpServerConfig
impl RefUnwindSafe for HttpServerConfig
impl Send for HttpServerConfig
impl Sync for HttpServerConfig
impl Unpin for HttpServerConfig
impl UnwindSafe for HttpServerConfig
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