Current section
Files
Jump to
Current section
Files
src/finch/stream.gleam
import finch/headers.{Headers as ReqHeaders}
/// A block of data sent by Finch from the HTTP request stream.
pub type StreamBlock {
Status(status: Int)
Headers(headers: ReqHeaders)
Data(data: BitString)
}
/// A stream handler function
///
/// Receives a block of the stream data as the first argument and the
/// accumulator as the second, must return the accumulator.
pub type StreamFun(a) =
fn(StreamBlock, a) -> a