package devkit

  1. Overview
  2. Docs
Development kit - general purpose library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.20261006.tar.gz
md5=a39dbbce04bd5562a9b4443daf39c582
sha512=b10104b61384b2151521b785e7f3c3250134c75eae09b42cad69bc4a22a9a5e429beb891ee87cedf376c23d9c40f09d3f71c3fd48aa35df490c0f69dc17f3242

doc/src/devkit.ocamlnet_lite/netsys_types.ml.html

Source file netsys_types.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(* WARNING! THIS IS A COPY OF NETSYS_TYPES.MLI! *)

(** Types for all Netsys modules *)

(** {2 Bytes and characters} *)

(** Remember that up to OCaml-4.01 there was only the [string] type,
    and strings were mutable (although frequently used as if there were
    immutable). Since OCaml-4.02 there is the immutable [string] and
    the mutable [bytes] type.

    The general strategy for switching to the string/bytes scheme is
    to replace [string] everywhere with [bytes], and to provide
    additional functions taking strings as input or output where it
    makes sense. There are exceptions, though, e.g. when the string
    acts as a key in a data structure.

    The type name "string" also occurs in function names (e.g.
    "get_string") and in variant names (e.g. [String_case]). As we
    want to be backward compatible, we keep the old names for functions
    on [bytes], and mark them as deprecated. 
 *)

type tbuffer = [ `Bytes of Bytes.t | `String of Bytes.t ]
  (** A tagged buffer. Note that the [`String] case is deprecated, and only
      provided for backward compatibility.
   *)

type tstring = [ `Bytes of Bytes.t | `String of string ]
  (** A tagged string which is considered as immutable. See also the
      support module {!Netstring_tstring}.
   *)