StorageBytes.from_string.size: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes Lines 113-126 of mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&start_line=113&end_line=126 import Base def from_string.size(+text: String, +size: U32, fits: Bool) -> Maybe<&2, U32>: match text fits: case SNil{} _: Some{size} case SCon{Chr{_scalar}, SNil{}} False{}: None{} case SCon{Chr{scalar}, SNil{}} True{}: Some{(size + utf8.width(scalar) : U32)} case SCon{Chr{_scalar}, SCon{Chr{_next_scalar}, _rest}} False{}: None{} case SCon{Chr{scalar}, SCon{Chr{next_scalar}, rest}} True{}: from_string.size(SCon{Chr{next_scalar}, rest}, (size + utf8.width(scalar) : U32), U32.is_le((size + utf8.width(scalar) : U32), (MAX_RECORD_BYTES() - utf8.width(next_scalar) : U32))) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=MAX_RECORD_BYTES https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend&name=utf8.width