pub struct HyperTransport<C = ProxyConnector<TimeoutConnector<HttpConnector>>> { /* private fields */ }Expand description
A transport implementation using hyper v1.x
This struct wraps a hyper client and implements the HttpTransport trait.
§Timeout Support
All three timeout types are fully supported via hyper-timeout:
connect_timeout- Timeout for establishing the TCP connectionread_timeout- Timeout for reading data from the connectionwrite_timeout- Timeout for writing data to the connection
Timeouts are configured using the builder pattern. See HyperTransportBuilder for details.
§Example
use launchdarkly_sdk_transport::HyperTransport;
// Create transport with default HTTP connector
let _transport = HyperTransport::new()?;
Implementations§
Source§impl HyperTransport
impl HyperTransport
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Create a new HyperTransport with default HTTP connector and no timeouts
This creates a basic HTTP-only client that supports both HTTP/1 and HTTP/2.
For HTTPS support or timeout configuration, use HyperTransport::builder().
Sourcepub fn builder() -> HyperTransportBuilder
pub fn builder() -> HyperTransportBuilder
Create a new builder for configuring HyperTransport
The builder allows you to configure timeouts and choose between HTTP and HTTPS connectors.
§Example
use launchdarkly_sdk_transport::HyperTransport;
use std::time::Duration;
let transport = HyperTransport::builder()
.connect_timeout(Duration::from_secs(10))
.read_timeout(Duration::from_secs(30))
.build_http();Trait Implementations§
Source§impl<C: Clone> Clone for HyperTransport<C>
impl<C: Clone> Clone for HyperTransport<C>
Source§fn clone(&self) -> HyperTransport<C>
fn clone(&self) -> HyperTransport<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C> HttpTransport for HyperTransport<C>
impl<C> HttpTransport for HyperTransport<C>
Auto Trait Implementations§
impl<C = ProxyConnector<TimeoutConnector<HttpConnector>>> !RefUnwindSafe for HyperTransport<C>
impl<C = ProxyConnector<TimeoutConnector<HttpConnector>>> !UnwindSafe for HyperTransport<C>
impl<C> Freeze for HyperTransport<C>
impl<C> Send for HyperTransport<C>
impl<C> Sync for HyperTransport<C>
impl<C> Unpin for HyperTransport<C>
impl<C> UnsafeUnpin for HyperTransport<C>
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