pub struct HttpServer<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> { /* private fields */ }Expand description
Simple HTTP server implementation
Note: This server only supports HTTP connections, not HTTPS/TLS. For secure connections, consider using a reverse proxy or load balancer that handles TLS termination.
Implementationsยง
Sourceยงimpl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
Sourcepub fn with_timeouts(port: u16, timeouts: ServerTimeouts) -> Self
pub fn with_timeouts(port: u16, timeouts: ServerTimeouts) -> Self
Create a new HTTP server with custom timeouts
Sourcepub async fn serve<H>(&mut self, stack: Stack<'_>, handler: H) -> !where
H: HttpHandler,
pub async fn serve<H>(&mut self, stack: Stack<'_>, handler: H) -> !where
H: HttpHandler,
Start the HTTP server and handle incoming connections
Important: This server only accepts plain HTTP connections. HTTPS/TLS is not supported by the server (only by the client).
Auto Trait Implementationsยง
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> Freeze for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> RefUnwindSafe for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> Send for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> Sync for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> Unpin for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
impl<const RX_SIZE: usize, const TX_SIZE: usize, const REQ_SIZE: usize, const MAX_RESPONSE_SIZE: usize> UnwindSafe for HttpServer<RX_SIZE, TX_SIZE, REQ_SIZE, MAX_RESPONSE_SIZE>
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