package iostream

  1. Overview
  2. Docs
Generic, composable IO input and output streams

Install

dune-project
 Dependency

Authors

Maintainers

Sources

iostream-0.2.1.tbz
sha256=09cd438f755d46bf10e986be0d3dd2ab243b1f5455c3c7410dcde8de521615a9
sha512=c5f4c251ba33386dd027d2cf340268d14fdbcd3119be6bac3586fd9ad1e9f90992ef12e8fd9fbf2442c6747560d84fd2461656ea639f818e53d0b08e82dd8e9a

doc/iostream/Iostream/Slice/index.html

Module Iostream.SliceSource

Byte slice or buffer.

Sourcetype t = {
  1. bytes : bytes;
    (*

    Bytes

    *)
  2. mutable off : int;
    (*

    Offset in bytes

    *)
  3. mutable len : int;
    (*

    Length of the slice. Empty slice has len=0

    *)
}

A slice of bytes. The valid bytes in the slice are bytes[off], bytes[off+1], …, bytes[off+len-1] (i.e len bytes starting at offset off).

Sourceval empty : t
Sourceval create : int -> t
Sourceval of_bytes : bytes -> t
Sourceval bytes : t -> bytes
Sourceval off : t -> int
Sourceval len : t -> int
Sourceval consume : t -> int -> unit

Consume the first n bytes from the slice, making it n bytes shorter. This modifies the slice in place.

Sourceval find_index_exn : t -> char -> int

find index of c in slice, or raise Not_found