Struct kern::http::server::HttpServer
source · pub struct HttpServer<S: Send + Sync + 'static> { /* private fields */ }
Expand description
Processes incoming HTTP connections
Implementations§
source§impl<S: Send + Sync + 'static> HttpServer<S>
impl<S: Send + Sync + 'static> HttpServer<S>
sourcepub fn new(
addr: String,
settings: Arc<HttpSettings>,
handler: Handler<S>,
error_handler: ErrorHandler<S>,
shared: Arc<RwLock<S>>,
threads: usize
) -> Result<Arc<Self>>
pub fn new( addr: String, settings: Arc<HttpSettings>, handler: Handler<S>, error_handler: ErrorHandler<S>, shared: Arc<RwLock<S>>, threads: usize ) -> Result<Arc<Self>>
Create new HttpServer and listen
sourcepub fn settings(&self) -> &HttpSettings
pub fn settings(&self) -> &HttpSettings
Get HttpSettings
Read access to shared
Write access to shared
sourcepub fn threads(&self) -> Result<RwLockReadGuard<'_, Vec<JoinHandle<()>>>>
pub fn threads(&self) -> Result<RwLockReadGuard<'_, Vec<JoinHandle<()>>>>
Read access to threads
sourcepub fn threads_mut(&self) -> Result<RwLockWriteGuard<'_, Vec<JoinHandle<()>>>>
pub fn threads_mut(&self) -> Result<RwLockWriteGuard<'_, Vec<JoinHandle<()>>>>
Write access to shared
Trait Implementations§
Auto Trait Implementations§
impl<S> RefUnwindSafe for HttpServer<S>
impl<S> Send for HttpServer<S>
impl<S> Sync for HttpServer<S>
impl<S> Unpin for HttpServer<S>
impl<S> UnwindSafe for HttpServer<S>
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