Sse.set: def of bend-kit-llm@0.13.0.1 Import: import bend-kit-llm@0.13.0.1/sse.bend as Sse Lines 123-140 of bend-kit-llm@0.13.0.1/sse.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-llm@0.13.0.1/sse.bend&start_line=123&end_line=140 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # The event after a field of kind k with value v. An id with NUL and a retry that is not digits change nothing. def set(+k: U32, v: Bytes.Bytes, st: St) -> St: match k: case 1: St{name, data, id, retry} = st St{name, Bytes.append(Bytes.append(data, v), lf()), id, retry} case 2: St{old, data, id, retry} = st St{Bytes.to_string(v), data, id, retry} case 3: St{name, data, old, retry} = st +s = Bytes.to_string(v) St{name, data, Bool.pick(String, has_nul(s), old, s), retry} case 4: St{name, data, id, old} = st St{name, data, id, set.retry(digits(Bytes.to_string(v), 0, 0, False{}), old)} case _: st Uses (14): 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=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 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=append https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=to_string https://jend.leeeet.dev/definition.txt?path=bend-kit-llm@0.13.0.1/sse.bend&name=St https://jend.leeeet.dev/definition.txt?path=bend-kit-llm@0.13.0.1/sse.bend&name=digits https://jend.leeeet.dev/definition.txt?path=bend-kit-llm@0.13.0.1/sse.bend&name=has_nul https://jend.leeeet.dev/definition.txt?path=bend-kit-llm@0.13.0.1/sse.bend&name=lf https://jend.leeeet.dev/definition.txt?path=bend-kit-llm@0.13.0.1/sse.bend&name=set.retry