= 1024" x-on:close-sidebar="sidebar=window.innerWidth >= 1024 && true">
package containers
-
containers
-
containers.bencode
-
containers.cbor
-
containers.codegen
-
containers.monomorphic
-
containers.top
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Byte buffer.
A dynamic vector of bytes.
- since 3.7
val create : ?cap:int -> unit -> t
Create a new buffer with given initial capacity.
val length : t -> int
Current length.
val is_empty : t -> bool
is_empty b
is length b=0
val bytes : t -> bytes
Access the underlying byte buffer. This buffer can change after operations that affect the capacity (e.g. add_char
).
val clear : t -> unit
val ensure_cap : t -> int -> unit
ensure_cap self n
ensures that capacity self >= n
.
val shrink_to : t -> int -> unit
shrink_to buf n
reduces length buf
to at most n
. Does nothing if the length is already <= n.
val add_char : t -> char -> unit
Push a character at the end.
val append_bytes : t -> bytes -> unit
val append_subbytes : t -> bytes -> int -> int -> unit
val append_string : t -> string -> unit
val append_substring : t -> string -> int -> int -> unit
val get : t -> int -> char
val unsafe_get : t -> int -> char
val set : t -> int -> char -> unit
val unsafe_set : t -> int -> char -> unit
val contents : t -> string
Copy the internal data to a string
val contents_bytes : t -> bytes
Copy the internal data to a byte buffer
val iter : (char -> unit) -> t -> unit
val fold_left : ('a -> char -> 'a) -> 'a -> t -> 'a