Documentation

Std.Internal.Http.Data.Body.Full

Body.Full #

A body backed by a fixed ByteArray held in a Mutex.

The byte array is consumed at most once: the first call to recv atomically takes the data and returns it as a single chunk; subsequent calls return none (end-of-stream). Closing the body discards any unconsumed data.

A body backed by a fixed, mutex-protected ByteArray.

The data is consumed on the first read. Once consumed (or explicitly closed), the body behaves as a closed, empty channel.

Instances For

    Creates a Full body from a ByteArray.

    Equations
    Instances For

      Creates a Full body from a String.

      Equations
      Instances For

        Receives the body data. Returns the full byte array on the first call as a single chunk, then none on all subsequent calls.

        Equations
        Instances For

          Closes the body, discarding any unconsumed data.

          Equations
          Instances For

            Returns true when the data has been consumed or the body has been closed.

            Equations
            Instances For

              Returns the known size of the remaining data. Returns some (.fixed n) with the current byte count, or some (.fixed 0) if the body has already been consumed or closed.

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

                Selector that immediately resolves to the remaining chunk (or EOF).

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

                  Builds a request body from raw bytes without setting any headers. Use bytes instead if you want Content-Type: application/octet-stream set automatically.

                  Equations
                  Instances For

                    Builds a request with a binary body. Sets Content-Type: application/octet-stream. Use fromBytes instead if you need to set a different Content-Type or none at all.

                    Equations
                    Instances For

                      Builds a request with a text body. Sets Content-Type: text/plain; charset=utf-8.

                      Equations
                      Instances For

                        Builds a request with a JSON body. Sets Content-Type: application/json.

                        Equations
                        Instances For

                          Builds a request with an HTML body. Sets Content-Type: text/html; charset=utf-8.

                          Equations
                          Instances For

                            Builds a response body from raw bytes without setting any headers. Use bytes instead if you want Content-Type: application/octet-stream set automatically.

                            Equations
                            Instances For

                              Builds a response with a binary body. Sets Content-Type: application/octet-stream. Use fromBytes instead if you need to set a different Content-Type or none at all.

                              Equations
                              Instances For

                                Builds a response with a text body. Sets Content-Type: text/plain; charset=utf-8.

                                Equations
                                Instances For

                                  Builds a response with a JSON body. Sets Content-Type: application/json.

                                  Equations
                                  Instances For

                                    Builds a response with an HTML body. Sets Content-Type: text/html; charset=utf-8.

                                    Equations
                                    Instances For