MlbendHuggingface.bytes_of: def of mlbend-huggingface@0.1.1.0 Import: import mlbend-huggingface@0.1.1.0/main.bend as MlbendHuggingface Lines 92-100 of mlbend-huggingface@0.1.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=mlbend-huggingface@0.1.1.0/main.bend&start_line=92&end_line=100 import Base import bend-kit-http@0.36.0.0/http.bend as Http import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # The bytes of a response, or the reason there are none. def bytes_of(r: Result<&1, &1, Http.Err, Http.Res>) -> Result<&1, &1, Err, Bytes.Bytes>: match r: case Fail{e}: Fail{why_of(e)} case Done{Http.Res{+status, headers, body}}: Bool.pick(Result<&1, &1, Err, Bytes.Bytes>, U32.is_lt(status, 400), Done{body}, Fail{ErrStatus{status}}) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=Err https://jend.leeeet.dev/definition.txt?path=mlbend-huggingface@0.1.1.0/main.bend&name=why_of