use crate::config::BulkheadConfig;
use crate::service::Bulkhead;
use tower::Layer;
#[derive(Clone)]
pub struct BulkheadLayer {
config: BulkheadConfig,
}
impl BulkheadLayer {
pub fn new(config: BulkheadConfig) -> Self {
Self { config }
}
}
impl<S> Layer<S> for BulkheadLayer {
type Service = Bulkhead<S>;
fn layer(&self, service: S) -> Self::Service {
Bulkhead::new(service, self.config.clone())
}
}