Documentation

Std.Http.Data.Body.Full

Body.Full #

A body backed by a fixed ByteArray. The first call to recv returns the full byte array as a single chunk; subsequent calls return none (end-of-stream). Closing the body marks it closed. resetInPlace resets state to ready so the body can be read again.

A body backed by a fixed ByteArray.

Unlike Body.Stream, a Full body is replayable: resetInPlace resets the state to ready so the same body can be read again.

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 until the cursor is reset.

        Equations
        Instances For

          Closes the body, discarding any unconsumed data.

          Equations
          Instances For

            Returns true when the body has been closed or consumed.

            Equations
            Instances For

              Returns the known size of the remaining data. Returns some (.fixed n) with the byte count if not yet consumed, some (.fixed 0) otherwise.

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

                Non-blocking receive. Full bodies are always in-memory, so data is always immediately available. Returns some chunk on first call, some none (EOF) once consumed or closed.

                Equations
                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

                    Resets the cursor to position zero so the body can be re-read from the start. Since Full.data is always preserved in the struct, this always works regardless of whether close was previously called (e.g. by the connection loop after EOF).

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

                      Full is replayable: resetInPlace resets the cursor to zero so the body can be re-read from the start.

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