MCPcopy Create free account
hub / github.com/Effect-TS/effect / stream

Method stream

packages/effect/src/http/HttpServerRequest.ts:795–814  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

793 }
794
795 get stream(): Stream.Stream<Uint8Array, HttpServerError> {
796 const body = this.source.body
797 switch (body._tag) {
798 case "Empty": {
799 return Stream.empty
800 }
801 case "Uint8Array": {
802 return Stream.succeed(body.body)
803 }
804 case "Stream": {
805 return Stream.mapError(body.stream, (cause) => requestParseError(this, undefined, cause))
806 }
807 case "FormData": {
808 return streamFromReadable(this, new Response(body.formData).body)
809 }
810 case "Raw": {
811 return rawBodyStream(this, body.body)
812 }
813 }
814 }
815
816 private bytesEffect: Effect.Effect<Uint8Array, HttpServerError> | undefined
817 private get bytes(): Effect.Effect<Uint8Array, HttpServerError> {

Callers

nothing calls this directly

Calls 4

requestParseErrorFunction · 0.85
streamFromReadableFunction · 0.85
rawBodyStreamFunction · 0.85
succeedMethod · 0.45

Tested by

no test coverage detected