mist/internal/http2/handler

Types

pub type PendingSend {
  PendingSend(
    identifier: frame.StreamIdentifier(frame.Frame),
    data: BitArray,
    end: Bool,
    sent: option.Option(process.Subject(Result(Nil, Nil))),
  )
}

Constructors

pub type State {
  State(
    fragment: option.Option(frame.Frame),
    frame_buffer: buffer.Buffer,
    initial_receive_window_size: Int,
    last_stream_id: frame.StreamIdentifier(frame.Frame),
    pending_sends: List(PendingSend),
    receive_hpack_context: http2.HpackContext,
    self: process.Subject(stream.SendMessage),
    send_hpack_context: http2.HpackContext,
    send_timeout: Int,
    send_window_size: Int,
    receive_window_size: Int,
    settings: http2.Http2Settings,
    streams: dict.Dict(
      frame.StreamIdentifier(frame.Frame),
      stream.State,
    ),
  )
}

Constructors

Values

pub fn append_data(state: State, data: BitArray) -> State
pub fn call(
  state: State,
  conn: http.Connection,
  handler: fn(request.Request(http.Connection)) -> response.Response(
    http.ResponseData,
  ),
) -> Result(State, Result(Nil, String))
pub fn close_stream(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
) -> Result(State, String)
pub fn consume_data(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
  size: Int,
) -> Result(State, String)
pub fn headers_sent(
  state: State,
  id: frame.StreamIdentifier(frame.Frame),
) -> Bool
pub fn receive_hpack_context(
  state: State,
  context: http2.HpackContext,
) -> State
pub fn reset_stream(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
  error: frame.ConnectionError,
) -> Result(State, String)
pub fn send_data(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
  data: BitArray,
  end: Bool,
) -> Result(State, String)
pub fn send_data_reply(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
  data: BitArray,
  sent: process.Subject(Result(Nil, Nil)),
) -> Result(State, String)
pub fn send_hpack_context(
  state: State,
  context: http2.HpackContext,
) -> State
pub fn send_response(
  state: State,
  conn: http.Connection,
  id: frame.StreamIdentifier(frame.Frame),
  headers: BitArray,
  data: BitArray,
) -> Result(State, String)
pub fn set_headers_sent(
  state: State,
  id: frame.StreamIdentifier(frame.Frame),
) -> State
pub fn upgrade(
  data: BitArray,
  conn: http.Connection,
  self: process.Subject(stream.SendMessage),
  send_timeout: Int,
  initial_receive_window_size: Int,
) -> Result(State, String)
✨ Search Document