Body.Basic #
This module defines the Body typeclass for HTTP body streams, and shared conversion types
ToByteArray and FromByteArray used for encoding and decoding body content.
Typeclass for values that can be read as HTTP body streams.
- recv : α → Internal.IO.Async.Async (Option Chunk)
Receives the next body chunk. Returns
noneat end-of-stream. - close : α → Internal.IO.Async.Async Unit
Closes the body stream.
- isClosed : α → Internal.IO.Async.Async Bool
Returns
truewhen the body stream is closed. - recvSelector : α → Internal.IO.Async.Selector (Option Chunk)
Selector that resolves when a chunk is available or EOF is reached.
- getKnownSize : α → Internal.IO.Async.Async (Option Length)
Gets the declared size of the body.
- setKnownSize : α → Option Length → Internal.IO.Async.Async Unit
Sets the declared size of a body.
Instances
@[implicit_reducible]
Equations
- Std.Http.Body.instToByteArrayByteArray = { toByteArray := id }
@[implicit_reducible]
Equations
- Std.Http.Body.instToByteArrayString = { toByteArray := String.toUTF8 }
@[implicit_reducible]
Equations
- Std.Http.Body.instFromByteArrayByteArray = { fromByteArray := Except.ok }
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.