Http2.client.data.go: def of bend-kit-http2@0.4.0.0 Import: import bend-kit-http2@0.4.0.0/http2.bend as Http2 Lines 395-417 of bend-kit-http2@0.4.0.0/http2.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-http2@0.4.0.0/http2.bend&start_line=395&end_line=417 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes def client.data.go(n: Nat, body: Bytes.Bytes, take: U32, +id: U32, +max: U32, +connection: U32, +stream: U32, rev: List<&1, Bytes.Bytes>) -> Maybe<&1, BodySent>: match n: case 0n: None{} case 1n+p: match body: case Bytes.Bytes{0, buf}: Some{BodySent{Bytes.Bytes{0, buf}, True{}, stream, connection, List.reverse(&1, Bytes.Bytes, rev)}} case Bytes.Bytes{+len, buf}: match take: case 0: Some{BodySent{Bytes.Bytes{len, buf}, False{}, stream, connection, List.reverse(&1, Bytes.Bytes, rev)}} case +count: with_slice(Maybe<&1, BodySent>, Bytes.slice(Bytes.Bytes{len, buf}, 0, count), whole => part => with_slice(Maybe<&1, BodySent>, Bytes.slice(whole, count, (len - count : U32)), unused => rest => Maybe.bind(&1, Bytes.Bytes, BodySent, client.frame(encode(max, Frame{0, Bool.pick(U32, U32.is_eq(count, len), 1, 0), id, part})), packet => +new_connection = (connection - count : U32) +new_stream = (stream - count : U32) +remaining = (len - count : U32) client.data.go(p, rest, client.available(remaining, max, new_connection, new_stream), id, max, new_connection, new_stream, Con{packet, rev})))) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil 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-bytes@0.3.3.0/bytes.bend&name=slice https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=BodySent https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=Frame https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=client.available https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=client.frame https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=encode https://jend.leeeet.dev/definition.txt?path=bend-kit-http2@0.4.0.0/http2.bend&name=with_slice