pub enum HttpServerMode {
SingleThread,
MultiThread(HttpServerThreadPool),
}
Expand description
HTTP server run mode
SingleThread
- run in single threadMultiThread
- run with a thread pool (HttpServerThreadPool
)
Example:
let mut server = HttpServer::new(HttpServerMode::SingleThread, "127.0.0.1:3000");
let mut server = HttpServer::new(HttpServerMode::MultiThread(HttpServerThreadPool::new(2)), "127.0.0.1:3000");
Variants§
SingleThread
MultiThread(HttpServerThreadPool)
Auto Trait Implementations§
impl Freeze for HttpServerMode
impl !RefUnwindSafe for HttpServerMode
impl Send for HttpServerMode
impl Sync for HttpServerMode
impl Unpin for HttpServerMode
impl !UnwindSafe for HttpServerMode
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