pub struct HttpServer { /* private fields */ }Expand description
Http server to expose your Restate services.
Implementations§
Source§impl HttpServer
impl HttpServer
Sourcepub fn new(endpoint: Endpoint) -> Self
pub fn new(endpoint: Endpoint) -> Self
Create new HttpServer from an Endpoint.
Sourcepub async fn listen_and_serve(self, addr: SocketAddr)
pub async fn listen_and_serve(self, addr: SocketAddr)
Listen on the given address and serve.
The future will be completed once SIGTERM is sent to the process.
Sourcepub async fn serve(self, listener: TcpListener)
pub async fn serve(self, listener: TcpListener)
Serve on the given listener.
The future will be completed once SIGTERM is sent to the process.
Sourcepub async fn serve_with_cancel(
self,
listener: TcpListener,
cancel_signal_future: impl Future,
)
pub async fn serve_with_cancel( self, listener: TcpListener, cancel_signal_future: impl Future, )
Serve on the given listener, and cancel the execution with the given future.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpServer
impl !RefUnwindSafe for HttpServer
impl Send for HttpServer
impl Sync for HttpServer
impl Unpin for HttpServer
impl !UnwindSafe for HttpServer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more