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

Equations
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
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          Instances For

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

            Equations
            Instances For

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

              Equations
              • One or more equations did not get rendered due to their size.
              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

                Equations
                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
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Equations
                        Instances For

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

                          Equations
                          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.

                            Equations
                            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.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              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

                                  An empty chunk with no data and no extensions.

                                  Equations
                                  Instances For

                                    Creates a simple chunk without extensions.

                                    Equations
                                    Instances For

                                      Adds an extension to a chunk.

                                      Equations
                                      Instances For

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

                                        Equations
                                        Instances For
                                          @[implicit_reducible]
                                          Equations
                                          • One or more equations did not get rendered due to their size.

                                          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

                                            Creates an empty trailer with no headers.

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

                                              Inserts a trailer header field.

                                              Equations
                                              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.

                                                Equations
                                                Instances For
                                                  @[inline]

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

                                                  Equations
                                                  Instances For
                                                    @[inline]

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

                                                    Equations
                                                    Instances For
                                                      @[inline]

                                                      Checks if a trailer header with the given name exists.

                                                      Equations
                                                      Instances For
                                                        @[inline]

                                                        Removes a trailer header with the given name.

                                                        Equations
                                                        Instances For
                                                          @[inline]

                                                          Gets the number of trailer headers.

                                                          Equations
                                                          Instances For
                                                            @[inline]

                                                            Checks if the trailer has no headers.

                                                            Equations
                                                            Instances For

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

                                                              Equations
                                                              Instances For

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

                                                                Equations
                                                                Instances For

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

                                                                  Equations
                                                                  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.

                                                                    Equations
                                                                    Instances For
                                                                      @[implicit_reducible]
                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.