pub struct Server { /* private fields */ }Implementations§
Source§impl Server
impl Server
pub fn new(router: impl Into<Router>) -> Self
pub fn from_config(router: impl Into<Router>) -> Self
Sourcepub fn middleware<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn middleware<M: Middleware + 'static>(self, middleware: M) -> Self
pub fn host(self, host: &str) -> Self
pub fn port(self, port: u16) -> Self
pub async fn run(self) -> Result<(), Box<dyn Error + Send + Sync>>
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§
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