pub struct Server { /* private fields */ }Expand description
A HTTP server that handles incoming connections using coroutines
Implementations§
Source§impl Server
impl Server
Sourcepub fn new(service: impl Service, max_body_size: usize) -> Self
pub fn new(service: impl Service, max_body_size: usize) -> Self
Create a new Server instance with the given Service
Sourcepub fn with_config(service: impl Service, config: ServerConfig) -> Self
pub fn with_config(service: impl Service, config: ServerConfig) -> Self
Create a new Server instance with custom configuration
Sourcepub fn run(&self, addr: impl ToSocketAddrs) -> Result<()>
pub fn run(&self, addr: impl ToSocketAddrs) -> Result<()>
Runs the server until shutdown is called
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more