pub struct HttpServer { /* private fields */ }Implementations§
Source§impl HttpServer
impl HttpServer
pub async fn bind(config: HttpConfig) -> Result<Self>
pub fn local_addr(&self) -> SocketAddr
pub async fn add_route(&self, method: Method, pattern: &str, handler: Handler)
pub async fn run(&mut self) -> Result<()>
pub fn shutdown(&self)
Sourcepub fn cancellation_token(&self) -> CancellationToken
pub fn cancellation_token(&self) -> CancellationToken
Cancellation token shared with the accept loop, for supervisors that need to stop HTTP together with other protocol servers.
Auto Trait Implementations§
impl !Freeze for HttpServer
impl !RefUnwindSafe for HttpServer
impl !UnwindSafe for HttpServer
impl Forget for HttpServer
impl Move for HttpServer
impl Send for HttpServer
impl Sync for HttpServer
impl Unpin for HttpServer
impl UnsafeUnpin for HttpServerwhere
I32NotAllOnes: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const ArcInner<Handle> is !null: UnsafeUnpin,
PhantomData<ArcInner<Handle>>: UnsafeUnpin,
*const ArcInner<Handle> is !null: UnsafeUnpin,
PhantomData<ArcInner<Handle>>: UnsafeUnpin,
*const ArcInner<ScheduledIo> is !null: UnsafeUnpin,
PhantomData<ArcInner<ScheduledIo>>: UnsafeUnpin,
*const ArcInner<RwLock<Router>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<Router>>>: UnsafeUnpin,
*const ArcInner<TreeNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, usize)>: UnsafeUnpin,
PhantomData<IpCidr>: UnsafeUnpin,
*const ArcInner<MetricsRegistry> is !null: UnsafeUnpin,
PhantomData<ArcInner<MetricsRegistry>>: UnsafeUnpin,
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