pub struct HttpReceiver { /* private fields */ }
Implementations§
Source§impl HttpReceiver
impl HttpReceiver
pub fn new<T: AsRef<str>>(host: T) -> Self
pub fn route<T, Fut, S>(self, method: S, route: S, callback: T) -> Selfwhere
T: Fn(String, HttpRequest) -> Fut + Send + Sync + 'static,
Fut: Future<Output = HttpResponse> + Send + 'static,
S: AsRef<str>,
pub fn tls<T: AsRef<Path>>(self, cert_path: T, key_path: T) -> Self
pub fn on_event<T, Fut>(self, handler: T) -> Self
pub async fn receive(self) -> Result<()>
Auto Trait Implementations§
impl Freeze for HttpReceiver
impl !RefUnwindSafe for HttpReceiver
impl Send for HttpReceiver
impl Sync for HttpReceiver
impl Unpin for HttpReceiver
impl !UnwindSafe for HttpReceiver
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