Documentation

Std.Internal.Http.Data.Chunk

Chunk #

This module defines the Chunk type, which represents a chunk of data from a request or response.

Reference: https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1

@[reducible, inline]

A proposition stating that s is a valid chunk-extension name: every character in s is an HTTP token character and s is non-empty.

Reference: https://httpwg.org/specs/rfc9112.html#chunked.extension

Instances For

    A validated chunk extension name that ensures all characters conform to HTTP standards per RFC 9112 §7.1.1. Extension names appear in chunked transfer encoding as key-value metadata.

    Reference: https://httpwg.org/specs/rfc9112.html#chunked.extension

    Instances For

      Attempts to create an ExtensionName from a String, returning none if the string contains invalid characters or is empty.

      Instances For

        Creates an ExtensionName from a string, panicking with an error message if the string contains invalid characters or is empty.

        Instances For
          @[reducible, inline]

          A proposition asserting that s is a valid extension value, meaning every character passes Char.quotedStringChar (i.e. is qdtext or a valid quoted-pair payload).

          Reference: https://httpwg.org/specs/rfc9112.html#chunked.extension

          Instances For

            A validated chunk extension value that ensures all characters conform to HTTP standards per RFC 9112 §7.1.1. Extension values appear in chunked transfer encoding as metadata associated with extension names.

            Note: UTF-8 encoding is not supported. The quoting mechanism is strict and only permits escaping specific values. Additionally, the library does not support obs-text, which means certain UTF-8 characters or values outside of token, qdtext, and the limited set of escapable characters cannot be encoded.

            Reference: https://httpwg.org/specs/rfc9112.html#chunked.extension

            Instances For

              Quotes an extension value if it contains non-token characters, otherwise returns it as-is.

              Instances For

                Attempts to create an ExtensionValue from a String, returning none if the string contains characters that cannot be encoded as an HTTP quoted-string.

                Instances For

                  Creates an ExtensionValue from a string, panicking with an error message if the string contains characters that cannot be encoded as an HTTP quoted-string.

                  Instances For
                    structure Std.Http.Chunk :

                    Represents a chunk of data with optional extensions (key-value pairs).

                    Reference: https://httpwg.org/specs/rfc9112.html#rfc.section.7.1

                    Instances For
                      @[implicit_reducible]

                      An empty chunk with no data and no extensions.

                      Instances For

                        Creates a simple chunk without extensions.

                        Instances For

                          Adds an extension to a chunk.

                          Instances For

                            Interprets the chunk data as a UTF-8 encoded string.

                            Instances For

                              Trailer headers sent after the final chunk in HTTP/1.1 chunked transfer encoding. Per RFC 9112 §7.1.2, trailers allow the sender to include additional metadata after the message body, such as message integrity checks or digital signatures.

                              • headers : Headers

                                The trailer header fields as key-value pairs.

                              Instances For
                                @[implicit_reducible]

                                Creates an empty trailer with no headers.

                                Instances For
                                  @[inline]
                                  def Std.Http.Trailer.insert (trailer : Trailer) (name : Header.Name) (value : Header.Value) :

                                  Inserts a trailer header field.

                                  Instances For
                                    @[inline]
                                    def Std.Http.Trailer.insert! (trailer : Trailer) (name value : String) :

                                    Inserts a trailer header field from string name and value, panicking if either is invalid.

                                    Instances For
                                      @[inline]

                                      Retrieves the first value for the given trailer header name. Returns none if absent.

                                      Instances For
                                        @[inline]

                                        Retrieves all values for the given trailer header name. Returns none if absent.

                                        Instances For
                                          @[inline]

                                          Checks if a trailer header with the given name exists.

                                          Instances For
                                            @[inline]

                                            Removes a trailer header with the given name.

                                            Instances For
                                              @[inline]

                                              Gets the number of trailer headers.

                                              Instances For
                                                @[inline]

                                                Checks if the trailer has no headers.

                                                Instances For

                                                  Merges two trailers, accumulating values for duplicate keys from both.

                                                  Instances For

                                                    Converts the trailer headers to a list of key-value pairs.

                                                    Instances For

                                                      Converts the trailer headers to an array of key-value pairs.

                                                      Instances For
                                                        def Std.Http.Trailer.fold {α : Type u_1} (trailer : Trailer) (init : α) (f : αHeader.NameHeader.Valueα) :
                                                        α

                                                        Folds over all key-value pairs in the trailer headers.

                                                        Instances For