1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Refactor listeners building

This commit is contained in:
Quentin Gliech
2022-10-05 13:19:02 +02:00
parent 014a8366ed
commit c548417752
10 changed files with 245 additions and 157 deletions

View File

@ -22,9 +22,20 @@ use super::otel::TraceLayer;
#[derive(Debug, Default)]
pub struct ServerLayer<ReqBody> {
listener_name: Option<String>,
_t: PhantomData<ReqBody>,
}
impl<B> ServerLayer<B> {
#[must_use]
pub fn new(listener_name: Option<String>) -> Self {
Self {
listener_name,
_t: PhantomData,
}
}
}
impl<ReqBody, ResBody, S> Layer<S> for ServerLayer<ReqBody>
where
S: Service<Request<ReqBody>, Response = Response<ResBody>> + Clone + Send + 'static,