pub struct TimeoutNet<N> { /* private fields */ }Expand description
Timeout decorator for Net implementations
Implementations§
Trait Implementations§
Source§impl<N: Net> Net for TimeoutNet<N>
impl<N: Net> Net for TimeoutNet<N>
Source§fn get_bytes<'life0, 'async_trait>(
&'life0 self,
url: Url,
headers: Option<Headers>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, NetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_bytes<'life0, 'async_trait>(
&'life0 self,
url: Url,
headers: Option<Headers>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, NetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all bytes from a URL
Source§fn get_range<'life0, 'async_trait>(
&'life0 self,
url: Url,
range: RangeSpec,
headers: Option<Headers>,
) -> Pin<Box<dyn Future<Output = Result<ByteStream, NetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_range<'life0, 'async_trait>(
&'life0 self,
url: Url,
range: RangeSpec,
headers: Option<Headers>,
) -> Pin<Box<dyn Future<Output = Result<ByteStream, NetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a range of bytes from a URL
Auto Trait Implementations§
impl<N> Freeze for TimeoutNet<N>where
N: Freeze,
impl<N> RefUnwindSafe for TimeoutNet<N>where
N: RefUnwindSafe,
impl<N> Send for TimeoutNet<N>where
N: Send,
impl<N> Sync for TimeoutNet<N>where
N: Sync,
impl<N> Unpin for TimeoutNet<N>where
N: Unpin,
impl<N> UnsafeUnpin for TimeoutNet<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for TimeoutNet<N>where
N: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> NetExt for Twhere
T: Net,
impl<T> NetExt for Twhere
T: Net,
Source§fn with_retry(
self,
policy: RetryPolicy,
cancel: CancellationToken,
) -> RetryNet<Self, DefaultRetryPolicy>
fn with_retry( self, policy: RetryPolicy, cancel: CancellationToken, ) -> RetryNet<Self, DefaultRetryPolicy>
Add retry layer
Source§fn with_timeout(self, timeout: Duration) -> TimeoutNet<Self>
fn with_timeout(self, timeout: Duration) -> TimeoutNet<Self>
Add timeout layer