pub struct Server { /* private fields */ }
Implementations§
Source§impl Server
impl Server
pub fn api<P, F, I, O>(self, path: P, f: F) -> Selfwhere
F: Fn(RequestInfo, I) -> O + 'static + Send + Sync,
for<'de> I: Deserialize<'de> + 'static,
O: Serialize + Send + 'static,
P: Into<String>,
pub fn result_api<P, F, I, O, E>(self, path: P, f: F) -> Self
pub fn async_api<P, FT, F, I, O, E>(self, path: P, f: F) -> Self
pub fn custom<P, F>(self, path: P, f: F) -> Self
pub fn static_dir<S: Into<String>>(self, path: S) -> Self
pub fn port(self, port: usize) -> Self
pub fn address<S: Into<String>>(self, addr: S) -> Self
pub fn run(self)
Trait Implementations§
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