pub struct Server { /* private fields */ }
Implementations§
Source§impl Server
impl Server
pub fn new(_configuration: Configuration) -> ServerResult<Self>
Source§impl Server
impl Server
pub fn run_and_wait(_configuration: Configuration) -> ServerResult
pub async fn run(_configuration: Configuration) -> ServerResult
pub fn serve_and_wait(&self) -> ServerResult
pub async fn serve(&self) -> ServerResult
Source§impl Server
impl Server
pub fn run_and_wait_with_handler<H, F>(
_configuration: Configuration,
_handler: H,
) -> ServerResultwhere
H: Handler<Future = F> + Send + Sync + 'static + Clone,
F: Future<Output = ServerResult<Response<H::ResponseBody>>> + Send + 'static,
pub async fn run_with_handler<H, F>(
_configuration: Configuration,
_handler: H,
) -> ServerResultwhere
H: Handler<Future = F> + Send + Sync + 'static + Clone,
F: Future<Output = ServerResult<Response<H::ResponseBody>>> + Send + 'static,
pub fn serve_and_wait_with_handler<H, F>(&self, _handler: H) -> ServerResultwhere
H: Handler<Future = F> + Send + Sync + 'static + Clone,
F: Future<Output = ServerResult<Response<H::ResponseBody>>> + Send + 'static,
pub async fn serve_with_handler<H, F>(&self, _handler: H) -> ServerResultwhere
H: Handler<Future = F> + Send + Sync + 'static + Clone,
F: Future<Output = ServerResult<Response<H::ResponseBody>>> + Send + 'static,
Source§impl Server
impl Server
pub fn serve_builder(&self) -> ServerResult<Builder<Accepter, ServerExecutor>>
pub async fn serve_with_service_fn<S, SF, SB, SBD>( &self, _service: S, ) -> ServerResult
pub async fn serve_with_make_service_fn<M, MF, ME, S, SF, SE, SB, SBD, SBE>(
&self,
_make_service: M,
) -> ServerResultwhere
M: FnMut(&Connection) -> MF + Send + 'static,
MF: Future<Output = Result<S, ME>> + Send + 'static,
ME: Error + Send + Sync + 'static,
S: Service<Request<Body>, Response = Response<SB>, Future = SF, Error = SE> + Send + 'static,
SE: Error + Send + Sync + 'static,
SF: Future<Output = Result<Response<SB>, SE>> + Send + 'static,
SB: BodyTrait<Data = SBD, Error = SBE> + Send + Sync + 'static,
SBD: Buf + Send + 'static,
SBE: Error + Send + Sync + 'static,
pub fn serve_protocol(&self) -> ServerResult<Http>
pub fn serve_runtime(&self) -> ServerResult<Runtime>
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