pub struct PersistentHttpConnection { /* private fields */ }Expand description
Encapsulates a HttpClientSession, enabling multiple requests to be queued and used on a single session.
It ensures only one request can be in flight at a time, and will buffer the request until the connection is established. This utilizes HTTP 1.x keep-alive headers to attempt to re-use the same connection for multiple requests.
Requests are started by calling PersistentHttpConnection::request, which will return a PendingHttpResponse.
These pending http response will coordinate with one another to send requests and drive responses in the order the function was called.
An HTTP server may elect to close an http session at any time.
When this occurs, a new PersistentHttpConnection must be created from the original HttpClient.
Implementations§
Trait Implementations§
Source§impl Debug for PersistentHttpConnection
impl Debug for PersistentHttpConnection
Source§impl From<HttpClientSession> for PersistentHttpConnection
impl From<HttpClientSession> for PersistentHttpConnection
Source§fn from(session: HttpClientSession) -> Self
fn from(session: HttpClientSession) -> Self
Converts to this type from the input type.
Source§impl Session for PersistentHttpConnection
impl Session for PersistentHttpConnection
Source§fn status(&self) -> SessionStatus
fn status(&self) -> SessionStatus
Check the current session status. Read more
Source§fn drive(&mut self) -> Result<DriveOutcome, Error>
fn drive(&mut self) -> Result<DriveOutcome, Error>
Some implementations will internally buffer payloads or require a duty cycle to drive callbacks.
Those implementations will require
drive(..) to be called continuously to completely publish and/or receive data.
This function will return DriveOutcome::Active if work was done, indicating to any scheduler that more work may be pending.
When this function returns DriveOutcome::Idle, only then should it indicate to a scheduler that yielding or idling is appropriate.Auto Trait Implementations§
impl Freeze for PersistentHttpConnection
impl !RefUnwindSafe for PersistentHttpConnection
impl !Send for PersistentHttpConnection
impl !Sync for PersistentHttpConnection
impl Unpin for PersistentHttpConnection
impl !UnwindSafe for PersistentHttpConnection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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