multipartkit
Top-level facade for the multipartkit library.
Re-exports the public types and the most common functions from the submodules. Less frequently used helpers (header lookup, validation, boundary extraction, content-disposition parsing, …) live on their dedicated submodules.
Types
Re-export of multipartkit/content_disposition.ContentDisposition.
pub type ContentDisposition =
content_disposition.ContentDisposition
Re-export of multipartkit/limit.LimitConfigError.
pub type LimitConfigError =
limit.LimitConfigError
Re-export of multipartkit/limit.Limits.
pub type Limits =
limit.Limits
Re-export of multipartkit/error.MultipartError.
pub type MultipartError =
error.MultipartError
Re-export of multipartkit/stream.StreamPart.
pub type StreamPart =
stream.StreamPart
Values
pub fn default_limits() -> limit.Limits
Re-export of multipartkit/limit.default_limits.
pub fn encode(
boundary: String,
parts: List(part.Part),
) -> BitArray
Re-export of multipartkit/encoder.encode.
pub fn encode_form(the_form: form.Form) -> #(String, BitArray)
Re-export of multipartkit/encoder.encode_form.
pub fn encode_stream(
boundary: String,
parts: yielder.Yielder(stream.StreamPart),
) -> yielder.Yielder(Result(BitArray, error.MultipartError))
Re-export of multipartkit/encoder.encode_stream.
pub fn new_limits(
max_body_bytes max_body_bytes: Int,
max_part_bytes max_part_bytes: Int,
max_parts max_parts: Int,
max_header_bytes max_header_bytes: Int,
) -> Result(limit.Limits, limit.LimitConfigError)
Re-export of multipartkit/limit.new. Construct a validated
Limits value; non-positive fields surface as
LimitConfigError.NonPositiveLimit.
pub fn parse(
body: BitArray,
content_type: String,
) -> Result(List(part.Part), error.MultipartError)
Re-export of multipartkit/parser.parse.
pub fn parse_stream(
chunks: yielder.Yielder(BitArray),
content_type: String,
) -> Result(
yielder.Yielder(Result(stream.StreamPart, error.MultipartError)),
error.MultipartError,
)
Re-export of multipartkit/stream.parse_stream.
pub fn parse_stream_with_limits(
chunks: yielder.Yielder(BitArray),
content_type: String,
limits: limit.Limits,
) -> Result(
yielder.Yielder(Result(stream.StreamPart, error.MultipartError)),
error.MultipartError,
)
Re-export of multipartkit/stream.parse_stream_with_limits.
pub fn parse_with_limits(
body: BitArray,
content_type: String,
limits: limit.Limits,
) -> Result(List(part.Part), error.MultipartError)
Re-export of multipartkit/parser.parse_with_limits.