Struct hyper_timeout::TimeoutConnector
source · [−]pub struct TimeoutConnector<T> { /* private fields */ }
Expand description
A connector that enforces as connection timeout
Implementations
sourceimpl<T> TimeoutConnector<T> where
T: Service<Uri> + Send,
T::Response: AsyncRead + AsyncWrite + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
impl<T> TimeoutConnector<T> where
T: Service<Uri> + Send,
T::Response: AsyncRead + AsyncWrite + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
sourceimpl<T> TimeoutConnector<T>
impl<T> TimeoutConnector<T>
sourcepub fn set_connect_timeout(&mut self, val: Option<Duration>)
pub fn set_connect_timeout(&mut self, val: Option<Duration>)
Set the timeout for connecting to a URL.
Default is no timeout.
sourcepub fn set_read_timeout(&mut self, val: Option<Duration>)
pub fn set_read_timeout(&mut self, val: Option<Duration>)
Set the timeout for the response.
Default is no timeout.
sourcepub fn set_write_timeout(&mut self, val: Option<Duration>)
pub fn set_write_timeout(&mut self, val: Option<Duration>)
Set the timeout for the request.
Default is no timeout.
Trait Implementations
sourceimpl<T: Clone> Clone for TimeoutConnector<T>
impl<T: Clone> Clone for TimeoutConnector<T>
sourcefn clone(&self) -> TimeoutConnector<T>
fn clone(&self) -> TimeoutConnector<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Connection for TimeoutConnector<T> where
T: AsyncRead + AsyncWrite + Connection + Service<Uri> + Send + Unpin,
T::Response: AsyncRead + AsyncWrite + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
impl<T> Connection for TimeoutConnector<T> where
T: AsyncRead + AsyncWrite + Connection + Service<Uri> + Send + Unpin,
T::Response: AsyncRead + AsyncWrite + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
sourceimpl<T: Debug> Debug for TimeoutConnector<T>
impl<T: Debug> Debug for TimeoutConnector<T>
sourceimpl<T> Service<Uri> for TimeoutConnector<T> where
T: Service<Uri> + Send,
T::Response: AsyncRead + AsyncWrite + Connection + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
impl<T> Service<Uri> for TimeoutConnector<T> where
T: Service<Uri> + Send,
T::Response: AsyncRead + AsyncWrite + Connection + Send + Unpin,
T::Future: Send + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
type Response = Pin<Box<TimeoutConnectorStream<<T as Service<Uri>>::Response>, Global>>
type Response = Pin<Box<TimeoutConnectorStream<<T as Service<Uri>>::Response>, Global>>
Responses given by the service.
type Future = Pin<Box<dyn Future<Output = Result<<TimeoutConnector<T> as Service<Uri>>::Response, <TimeoutConnector<T> as Service<Uri>>::Error>> + Send + 'static, Global>>
type Future = Pin<Box<dyn Future<Output = Result<<TimeoutConnector<T> as Service<Uri>>::Response, <TimeoutConnector<T> as Service<Uri>>::Error>> + Send + 'static, Global>>
The future response value.
Auto Trait Implementations
impl<T> RefUnwindSafe for TimeoutConnector<T> where
T: RefUnwindSafe,
impl<T> Send for TimeoutConnector<T> where
T: Send,
impl<T> Sync for TimeoutConnector<T> where
T: Sync,
impl<T> Unpin for TimeoutConnector<T> where
T: Unpin,
impl<T> UnwindSafe for TimeoutConnector<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more