package core_kernel
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=1d91a0d58e9a98809eb3bc888ae716e786c68ad5d07a874c37d9c1ef9fd24438
md5=77b25affd5155128ca757d38e496d89f
doc/core_kernel.iobuf/Iobuf/Expert/index.html
Module Iobuf.Expert
The Expert
module is for building efficient out-of-module Iobuf
abstractions.
val buf : (_, _) t -> Core_kernel.Bigstring.t
These accessors will not allocate, and are mainly here to assist in building low-cost syscall wrappers.
One must be careful to avoid writing out of the limits (between lo_min
and hi_max
) of the buf
. Doing so would violate the invariants of the parent Iobuf
.
val hi_max : (_, _) t -> int
val hi : (_, _) t -> int
val lo : (_, _) t -> int
val lo_min : (_, _) t -> int
val set_buf : (_, _) t -> Core_kernel.Bigstring.t -> unit
These setters directly set fields in t
without checking any invariants.
val set_hi_max : (_, _) t -> int -> unit
val set_hi : (_, _) t -> int -> unit
val set_lo : (_, _) t -> int -> unit
val set_lo_min : (_, _) t -> int -> unit
to_bigstring_shared t
and to_iobuf_shared t
allocate new wrappers around the storage of buf t
, relative to t
's current bounds.
These operations allow access outside the bounds and limits of t
, and without respect to its read/write access. Be careful not to violate t
's invariants.
val reinitialize_of_bigstring :
(_, _) t ->
pos:int ->
len:int ->
Core_kernel.Bigstring.t ->
unit
reinitialize_of_bigstring t bigstring
reinitializes t
with backing bigstring
, and the window and limits specified starting at pos
and of length len
.
These versions of set_bounds_and_buffer
allow ~src
to be read-only. ~dst
will be writable through ~src
aliases even though the type does not reflect this!