pub struct TimeoutConnector<T> { /* private fields */ }
Expand description
A connector that enforces a connection timeout
Implementations§
Source§impl<T> TimeoutConnector<T>
impl<T> TimeoutConnector<T>
Source§impl<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.
Sourcepub fn set_reset_reader_on_write(&mut self, reset: bool)
pub fn set_reset_reader_on_write(&mut self, reset: bool)
Reset on the reader timeout on write
This will reset the reader timeout when a write is done through the the TimeoutReader. This is useful when you don’t want to trigger a reader timeout while writes are still be accepted.
Trait Implementations§
Source§impl<T: Clone> Clone for TimeoutConnector<T>
impl<T: Clone> Clone for TimeoutConnector<T>
Source§fn clone(&self) -> TimeoutConnector<T>
fn clone(&self) -> TimeoutConnector<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Connection for TimeoutConnector<T>
impl<T> Connection for TimeoutConnector<T>
Source§impl<T: Debug> Debug for TimeoutConnector<T>
impl<T: Debug> Debug for TimeoutConnector<T>
Source§impl<T> Service<Uri> for TimeoutConnector<T>
impl<T> Service<Uri> for TimeoutConnector<T>
Source§type Response = Pin<Box<TimeoutStream<<T as Service<Uri>>::Response>>>
type Response = Pin<Box<TimeoutStream<<T as Service<Uri>>::Response>>>
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<TimeoutConnector<T> as Service<Uri>>::Response, <TimeoutConnector<T> as Service<Uri>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<TimeoutConnector<T> as Service<Uri>>::Response, <TimeoutConnector<T> as Service<Uri>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl<T> Freeze for TimeoutConnector<T>where
T: Freeze,
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§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)