Documentation

Init.Data.ByteArray.Basic

structure ByteArray:
Type
@[extern lean_mk_empty_byte_array]
Equations
@[extern lean_byte_array_push]
Equations
@[extern lean_byte_array_size]
Equations
@[extern lean_byte_array_uget]
Equations
  • ByteArray.uget _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := bs }, i, h => Array.uget bs i h
@[extern lean_byte_array_get]
Equations
@[extern lean_byte_array_fget]
Equations
@[inline]
def ByteArray.getOp (self : ByteArray) (idx : Nat) :
Equations
@[extern lean_byte_array_set]
Equations
  • ByteArray.set! _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := bs }, i, b => { data := Array.set! bs i b }
@[extern lean_byte_array_fset]
Equations
  • ByteArray.set _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr with | { data := bs }, i, b => { data := Array.set bs i b }
@[extern lean_byte_array_uset]
Equations
  • ByteArray.uset _fun_discr _fun_discr _fun_discr _fun_discr = match _fun_discr, _fun_discr, _fun_discr, _fun_discr with | { data := bs }, i, v, h => { data := Array.uset bs i v h }
@[extern lean_byte_array_copy_slice]
def ByteArray.copySlice (src : ByteArray) (srcOff : Nat) (dest : ByteArray) (destOff : Nat) (len : Nat) (exact : optParam Bool true) :

Copy the slice at [srcOff, srcOff + len) in src to [destOff, destOff + len) in dest, growing dest if necessary. If exact is false, the capacity will be doubled when grown.

Equations
  • One or more equations did not get rendered due to their size.
partial def ByteArray.toList.loop (bs : ByteArray) (i : Nat) (r : List UInt8) :
@[inline]
def ByteArray.findIdx? (a : ByteArray) (p : UInt8Bool) (start : optParam Nat 0) :
Equations
@[specialize]
partial def ByteArray.findIdx?.loop (a : ByteArray) (p : UInt8Bool) (i : Nat) :
@[inline]
unsafe def ByteArray.forInUnsafe {β : Type v} {m : Type vType w} [inst : Monad m] (as : ByteArray) (b : β) (f : UInt8βm (ForInStep β)) :
m β
Equations
@[specialize]
unsafe def ByteArray.forInUnsafe.loop {β : Type v} {m : Type vType w} [inst : Monad m] (as : ByteArray) (f : UInt8βm (ForInStep β)) (sz : USize) (i : USize) (b : β) :
m β
Equations
  • One or more equations did not get rendered due to their size.
@[implementedBy ByteArray.forInUnsafe]
def ByteArray.forIn {β : Type v} {m : Type vType w} [inst : Monad m] (as : ByteArray) (b : β) (f : UInt8βm (ForInStep β)) :
m β
Equations
def ByteArray.forIn.loop {β : Type v} {m : Type vType w} [inst : Monad m] (as : ByteArray) (f : UInt8βm (ForInStep β)) (i : Nat) (h : i ByteArray.size as) (b : β) :
m β
Equations
instance ByteArray.instForInByteArrayUInt8 {m : Type u_1Type u_2} :
Equations
  • ByteArray.instForInByteArrayUInt8 = { forIn := fun {β} [Monad m] => ByteArray.forIn }
@[inline]
unsafe def ByteArray.foldlMUnsafe {β : Type v} {m : Type vType w} [inst : Monad m] (f : βUInt8m β) (init : β) (as : ByteArray) (start : optParam Nat 0) (stop : optParam Nat (ByteArray.size as)) :
m β
Equations
  • One or more equations did not get rendered due to their size.
@[specialize]
unsafe def ByteArray.foldlMUnsafe.fold {β : Type v} {m : Type vType w} [inst : Monad m] (f : βUInt8m β) (as : ByteArray) (i : USize) (stop : USize) (b : β) :
m β
Equations
  • One or more equations did not get rendered due to their size.
@[implementedBy ByteArray.foldlMUnsafe]
def ByteArray.foldlM {β : Type v} {m : Type vType w} [inst : Monad m] (f : βUInt8m β) (init : β) (as : ByteArray) (start : optParam Nat 0) (stop : optParam Nat (ByteArray.size as)) :
m β
Equations
  • One or more equations did not get rendered due to their size.
def ByteArray.foldlM.loop {β : Type v} {m : Type vType w} [inst : Monad m] (f : βUInt8m β) (as : ByteArray) (stop : Nat) (h : stop ByteArray.size as) (i : Nat) (j : Nat) (b : β) :
m β
Equations
  • One or more equations did not get rendered due to their size.
@[inline]
def ByteArray.foldl {β : Type v} (f : βUInt8β) (init : β) (as : ByteArray) (start : optParam Nat 0) (stop : optParam Nat (ByteArray.size as)) :
β
Equations
Equations

Interpret a ByteArray of size 8 as a little-endian UInt64.

Equations
  • One or more equations did not get rendered due to their size.

Interpret a ByteArray of size 8 as a big-endian UInt64.

Equations
  • One or more equations did not get rendered due to their size.