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>

source

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

source

pub fn settings(&self) -> &HttpSettings

Get HttpSettings

source

pub fn shared(&self) -> Result<RwLockReadGuard<'_, S>>

Read access to shared

source

pub fn shared_mut(&self) -> Result<RwLockWriteGuard<'_, S>>

Write access to shared

source

pub fn threads(&self) -> Result<RwLockReadGuard<'_, Vec<JoinHandle<()>>>>

Read access to threads

source

pub fn threads_mut(&self) -> Result<RwLockWriteGuard<'_, Vec<JoinHandle<()>>>>

Write access to shared

source

pub fn block(&self) -> Result<()>

Block on join of a Thread’s JoinHandle

Trait Implementations§

source§

impl<S: Debug + Send + Sync + 'static> Debug for HttpServer<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.