Stream.transfer.start: def of bend-kit-stream@0.3.1.0 Import: import bend-kit-stream@0.3.1.0/stream.bend as Stream Lines 146-156 of bend-kit-stream@0.3.1.0/stream.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-stream@0.3.1.0/stream.bend&start_line=146&end_line=156 import Base def transfer.start(~S: Type, ~D: Type, ~read: S -> U32 -> Bool -> U32 -> IO(S & Result<&1, &1, U32 & String, U32 & Array>), ~write: D -> U32 -> Array -> Bool -> IO(D & Result<&1, &1, U32 & String, Unit>), valid: Bool, source: S, destination: D, tls: Bool, chunk: U32, +cap: U32, ms: U32) -> IO(S & D & Outcome): match valid: case False{}: IO.pure(S & D & Outcome, (source, destination, Failed{0, BadChunk{}})) case True{}: transfer.loop(~S, ~D, ~read, ~write, 1n+U32.to_nat(cap), More{source, destination, 0}, tls, chunk, cap, ms) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-stream@0.3.1.0/stream.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bend-kit-stream@0.3.1.0/stream.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bend-kit-stream@0.3.1.0/stream.bend&name=Transfer https://jend.leeeet.dev/definition.txt?path=bend-kit-stream@0.3.1.0/stream.bend&name=transfer.loop