HttpTransport

Struct HttpTransport 

Source
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: bool

Whether this connection supports keep-alive

§local_addr: SocketAddr

Local address of the connection

§remote_addr: SocketAddr

Remote address of the connection

§request_count: u64

Number of requests processed on this connection

§safety: HttpSafety

HTTP safety configuration (limits, timeouts, etc.)

§role: ProtocolRole

Role of this protocol instance

Implementations§

Source§

impl HttpTransport

Source

pub fn new( role: ProtocolRole, safety: HttpSafety, local_addr: SocketAddr, remote_addr: SocketAddr, ) -> HttpTransport

Creates a new HTTP/1.1 transport with socket addresses.

Source

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.

Source

pub fn set_addresses( &mut self, local: Option<SocketAddr>, remote: Option<SocketAddr>, )

Sets the socket addresses from connection metadata.

Source

pub fn increment_requests(&mut self)

Increments the request counter.

Source

pub fn should_keep_alive(&self) -> bool

Checks if the connection should be kept alive.

Source

pub fn update_keep_alive(&mut self, request: &HttpRequest)

Updates keep-alive based on request headers.

Trait Implementations§

Source§

impl Clone for HttpTransport

Source§

fn clone(&self) -> HttpTransport

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Transport for HttpTransport

Source§

fn id(&self) -> i128

Returns an identifier for this connection.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the transport as Any for downcasting.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns a mutable reference to the transport as Any.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParamValue for T
where T: Any + Clone + Send + Sync + 'static,

Source§

fn clone_box(&self) -> Box<dyn ParamValue>

Clones this value and returns it as a boxed ParamValue. Read more
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Returns a reference to the underlying value as Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns a mutable reference to the underlying value as Any. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V