package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.14.2.tar.gz
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff

doc/core_kernel.iobuf/Iobuf/Expert/index.html

Module Iobuf.ExpertSource

The Expert module is for building efficient out-of-module Iobuf abstractions.

Sourceval 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.

Sourceval hi_max : (_, _) t -> int
Sourceval hi : (_, _) t -> int
Sourceval lo : (_, _) t -> int
Sourceval lo_min : (_, _) t -> int
Sourceval set_buf : (_, _) t -> Core_kernel.Bigstring.t -> unit

These setters directly set fields in t without checking any invariants.

Sourceval set_hi_max : (_, _) t -> int -> unit
Sourceval set_hi : (_, _) t -> int -> unit
Sourceval set_lo : (_, _) t -> int -> unit
Sourceval set_lo_min : (_, _) t -> int -> unit
Sourceval to_bigstring_shared : ?pos:int -> ?len:int -> (_, _) t -> Core_kernel.Bigstring.t

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.

Sourceval 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.

Sourceval set_bounds_and_buffer : src:('data, _) t -> dst:('data, seek) t -> unit

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!

Sourceval set_bounds_and_buffer_sub : pos:int -> len:int -> src:('data, _) t -> dst:('data, seek) t -> unit
Sourceval protect_window : ('rw, _) t -> f:(('rw, seek) t -> 'a) -> 'a

Similar to protect_window_and_bounds, but does not save/restore the buffer or bounds. Mixing this with functions like set_bounds_and_buffer or narrow is unsafe; you should not modify anyything but the window inside f.