Coverage Report

Created: 2026-01-15 06:51

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/tower-0.5.2/src/timeout/layer.rs
Line
Count
Source
1
use super::Timeout;
2
use std::time::Duration;
3
use tower_layer::Layer;
4
5
/// Applies a timeout to requests via the supplied inner service.
6
#[derive(Debug, Clone)]
7
pub struct TimeoutLayer {
8
    timeout: Duration,
9
}
10
11
impl TimeoutLayer {
12
    /// Create a timeout from a duration
13
0
    pub const fn new(timeout: Duration) -> Self {
14
0
        TimeoutLayer { timeout }
15
0
    }
16
}
17
18
impl<S> Layer<S> for TimeoutLayer {
19
    type Service = Timeout<S>;
20
21
0
    fn layer(&self, service: S) -> Self::Service {
22
0
        Timeout::new(service, self.timeout)
23
0
    }
Unexecuted instantiation: <tower::timeout::layer::TimeoutLayer as tower_layer::Layer<tower::util::boxed_clone_sync::BoxCloneSyncService<reqwest::connect::sealed::Unnameable, reqwest::connect::sealed::Conn, alloc::boxed::Box<dyn core::error::Error + core::marker::Sync + core::marker::Send>>>>::layer
Unexecuted instantiation: <tower::timeout::layer::TimeoutLayer as tower_layer::Layer<_>>::layer
24
}