Skip to main content

ConnectionH1

Struct ConnectionH1 

Source
pub struct ConnectionH1<Front: SocketHandler> {
    pub position: Position,
    pub readiness: Readiness,
    pub requests: usize,
    pub socket: Front,
    pub stream: Option<usize>,
    pub timeout_container: TimeoutContainer,
    pub parked_on_buffer_pressure: bool,
    pub close_notify_sent: bool,
    pub session_ulid: Ulid,
}
Expand description

HTTP/1.1 connection handler within the mux layer.

Manages a single HTTP/1.1 connection (either frontend or backend), handling request/response forwarding through kawa buffers. Supports keep-alive, chunked transfer encoding, close-delimited responses, and upgrade (e.g., WebSocket).

Fields§

§position: Position§readiness: Readiness§requests: usize§socket: Front§stream: Option<usize>

Active stream index, or None when the connection has no assigned stream (initial client state before start_stream, or after end_stream detaches).

§timeout_container: TimeoutContainer§parked_on_buffer_pressure: bool

Set when readable exits early because the kawa buffer was full. Edge-triggered epoll will not re-fire READABLE for data already in the kernel socket buffer, so the cross-readiness mechanism must re-arm it via try_resume_reading once the peer drains the buffer.

§close_notify_sent: bool

True once we’ve asked rustls to emit TLS close_notify for this frontend.

§session_ulid: Ulid

Connection/session ULID propagated from the parent [Mux]. Used to stamp the session slot of the [session req cluster backend] log prefix emitted by the local log_context! macro.

Implementations§

Source§

impl<Front: SocketHandler> ConnectionH1<Front>

Source

pub fn readable<E, L>( &mut self, context: &mut Context<L>, endpoint: E, ) -> MuxResult

Source

pub fn writable<E, L>( &mut self, context: &mut Context<L>, endpoint: E, ) -> MuxResult

Source

pub fn force_disconnect(&mut self) -> MuxResult

Source

pub fn has_pending_write(&self) -> bool

Source

pub fn initiate_close_notify(&mut self) -> bool

Source

pub fn close<E, L>(&mut self, context: &mut Context<L>, endpoint: E)

Source

pub fn end_stream<L>(&mut self, stream: usize, context: &mut Context<L>)

Source

pub fn start_stream<L>( &mut self, stream: usize, _context: &mut Context<L>, ) -> bool

Trait Implementations§

Source§

impl<Front: SocketHandler> Debug for ConnectionH1<Front>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Front> !RefUnwindSafe for ConnectionH1<Front>

§

impl<Front> !Send for ConnectionH1<Front>

§

impl<Front> !Sync for ConnectionH1<Front>

§

impl<Front> !UnwindSafe for ConnectionH1<Front>

§

impl<Front> Freeze for ConnectionH1<Front>
where Front: Freeze,

§

impl<Front> Unpin for ConnectionH1<Front>
where Front: Unpin,

§

impl<Front> UnsafeUnpin for ConnectionH1<Front>
where Front: UnsafeUnpin,

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more