def bstr.copy

bend-kit-cbor@0.3.0.0 · cbor.bend:507

import bend-kit-cbor@0.3.0.0/cbor.bend as Cbor
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

507def bstr.copy(+n: U32, +i: U32, r: Array<U32> & Bool) -> Array<U32> & Maybe<&1, Bytes.Bytes>:
508  (a, ok) = r
509  match ok:
510    case True{}:
511      bstr.some(n, Bytes.copy(n, a, Bytes.alloc(n), i, 0))
512    case False{}:
513      (a, None{})

Uses (10)

Used by (1)