pub struct HttpTransport {
pub keep_alive: bool,
pub local_addr: SocketAddr,
pub remote_addr: SocketAddr,
pub request_count: u64,
pub safety: HttpSafety,
pub role: ProtocolRole,
/* private fields */
}Expand description
HTTP transport state.
Tracks connection-level state for HTTP:
- Connection ID for logging
- Keep-alive status
- Request count for connection reuse
- Safety configuration
Fields§
§keep_alive: boolWhether this connection supports keep-alive
local_addr: SocketAddrLocal address of the connection
remote_addr: SocketAddrRemote address of the connection
request_count: u64Number of requests processed on this connection
safety: HttpSafetyHTTP safety configuration (limits, timeouts, etc.)
role: ProtocolRoleRole of this protocol instance
Implementations§
Source§impl HttpTransport
impl HttpTransport
Sourcepub fn new(
role: ProtocolRole,
safety: HttpSafety,
local_addr: SocketAddr,
remote_addr: SocketAddr,
) -> HttpTransport
pub fn new( role: ProtocolRole, safety: HttpSafety, local_addr: SocketAddr, remote_addr: SocketAddr, ) -> HttpTransport
Creates a new HTTP/1.1 transport with socket addresses.
Sourcepub fn new_unbound(role: ProtocolRole, safety: HttpSafety) -> HttpTransport
pub fn new_unbound(role: ProtocolRole, safety: HttpSafety) -> HttpTransport
Creates a new HTTP/1.1 transport without socket addresses. Addresses should be set via set_addresses() when available.
Sourcepub fn set_addresses(
&mut self,
local: Option<SocketAddr>,
remote: Option<SocketAddr>,
)
pub fn set_addresses( &mut self, local: Option<SocketAddr>, remote: Option<SocketAddr>, )
Sets the socket addresses from connection metadata.
Sourcepub fn increment_requests(&mut self)
pub fn increment_requests(&mut self)
Increments the request counter.
Sourcepub fn should_keep_alive(&self) -> bool
pub fn should_keep_alive(&self) -> bool
Checks if the connection should be kept alive.
Sourcepub fn update_keep_alive(&mut self, request: &HttpRequest)
pub fn update_keep_alive(&mut self, request: &HttpRequest)
Updates keep-alive based on request headers.
Trait Implementations§
Source§impl Clone for HttpTransport
impl Clone for HttpTransport
Source§fn clone(&self) -> HttpTransport
fn clone(&self) -> HttpTransport
Returns a duplicate 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 Transport for HttpTransport
impl Transport for HttpTransport
Auto Trait Implementations§
impl Freeze for HttpTransport
impl RefUnwindSafe for HttpTransport
impl Send for HttpTransport
impl Sync for HttpTransport
impl Unpin for HttpTransport
impl UnwindSafe for HttpTransport
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§impl<T> ParamValue for T
impl<T> ParamValue for T
Source§fn clone_box(&self) -> Box<dyn ParamValue>
fn clone_box(&self) -> Box<dyn ParamValue>
Clones this value and returns it as a boxed
ParamValue. Read moreSource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying value as
Any. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to the underlying value as
Any. Read more