pub struct HttpServer<T>(pub T);
Expand description
this is the generic type http server
with a type parameter that impl HttpService
trait
Tuple Fields§
§0: T
Implementations§
Source§impl<T: HttpService + Clone + Send + Sync + 'static> HttpServer<T>
impl<T: HttpService + Clone + Send + Sync + 'static> HttpServer<T>
Sourcepub fn start<L: ToSocketAddrs>(self, addr: L) -> Result<JoinHandle<()>>
pub fn start<L: ToSocketAddrs>(self, addr: L) -> Result<JoinHandle<()>>
Spawns the http service, binding to the given address return a coroutine that you can cancel it when need to stop the service
Auto Trait Implementations§
impl<T> Freeze for HttpServer<T>where
T: Freeze,
impl<T> RefUnwindSafe for HttpServer<T>where
T: RefUnwindSafe,
impl<T> Send for HttpServer<T>where
T: Send,
impl<T> Sync for HttpServer<T>where
T: Sync,
impl<T> Unpin for HttpServer<T>where
T: Unpin,
impl<T> UnwindSafe for HttpServer<T>where
T: UnwindSafe,
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