pub struct TowerServer<TlsM> { /* private fields */ }Expand description
A bound server, ready for running accept-loop using a tower service.
Implementations§
Source§impl<TlsM> TowerServer<TlsM>
impl<TlsM> TowerServer<TlsM>
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Access the locally bound address
Sourcepub async fn serve<S, B>(self, tower_service: S)where
S: Service<Request<Incoming>, Response = Response<B>> + Send + Sync + 'static + Clone,
S::Future: 'static + Send,
S::Error: Into<Box<dyn StdError + Send + Sync + 'static>>,
B: Body + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync + 'static>>,
TlsM: TlsConnectionMiddleware,
pub async fn serve<S, B>(self, tower_service: S)where
S: Service<Request<Incoming>, Response = Response<B>> + Send + Sync + 'static + Clone,
S::Future: 'static + Send,
S::Error: Into<Box<dyn StdError + Send + Sync + 'static>>,
B: Body + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn StdError + Send + Sync + 'static>>,
TlsM: TlsConnectionMiddleware,
Run HTTP accept loop, handling every request using the passwed tower service.
Auto Trait Implementations§
impl<TlsM> !Freeze for TowerServer<TlsM>
impl<TlsM> !RefUnwindSafe for TowerServer<TlsM>
impl<TlsM> Send for TowerServer<TlsM>where
TlsM: Send,
impl<TlsM> Sync for TowerServer<TlsM>where
TlsM: Sync,
impl<TlsM> Unpin for TowerServer<TlsM>where
TlsM: Unpin,
impl<TlsM> !UnwindSafe for TowerServer<TlsM>
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