pub struct Server<'a> { /* private fields */ }Expand description
Asynchronous HTTP server that listens on a TCP socket and handles requests.
It will serves static and dynamic routes via a Router and logs each request with a Logger
Implementations§
Source§impl<'a> Server<'a>
impl<'a> Server<'a>
Sourcepub fn with_address(addr: &'a str) -> Result<Self, String>
pub fn with_address(addr: &'a str) -> Result<Self, String>
Creates a new server bound to addr, reading the configuration from a file named config.toml or used the default configuration
§Errors
Returns an error if the configuration or logger initialization fails
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Server<'a>
impl<'a> !RefUnwindSafe for Server<'a>
impl<'a> Send for Server<'a>
impl<'a> Sync for Server<'a>
impl<'a> Unpin for Server<'a>
impl<'a> !UnwindSafe for Server<'a>
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