Documentation

Std.Internal.Http.Data.Extensions

Extensions #

This module provides the Extensions type, a dynamically-typed map for storing metadata on HTTP requests and responses. It can be used by parsers, middleware, or other processing stages to attach arbitrary typed data.

A dynamically typed map for optional metadata that can be attached to HTTP requests and responses. Extensions allow storing arbitrary typed data keyed by type name, useful for metadata such as socket information or custom processing data.

Instances For

    An empty extensions map with no data.

    Equations
    Instances For
      @[inline]

      Retrieves a value of type α from the extensions, if present.

      Equations
      Instances For
        @[inline]
        def Std.Http.Extensions.insert {α : Type u_1} (x : Extensions) [TypeName α] (data : α) :

        Inserts a value into the extensions, keyed by its type name. If a value of the same type already exists, it is replaced.

        Equations
        Instances For
          @[inline]

          Removes the value of type α from the extensions.

          Equations
          Instances For
            @[inline]

            Checks whether the extensions contain a value of type α.

            Equations
            Instances For