Module Shexp_bigstring.Bigstring
val create : int -> tval length : t -> intval blit : src:t -> src_pos:int -> dst:t -> dst_pos:int -> len:int -> unitval blit_string_t : src:string -> src_pos:int -> dst:t -> dst_pos:int -> len:int -> unitval blit_t_bytes : src:t -> src_pos:int -> dst:Stdlib.Bytes.t -> dst_pos:int -> len:int -> unitval sub_string : t -> pos:int -> len:int -> stringval index : t -> pos:int -> len:int -> char:char -> int optionval rindex : t -> pos:int -> len:int -> char:char -> int optionval pos_len_ok : pos:int -> len:int -> length:int -> boolEfficiently checks that the range denoted by
(pos, len)is in the range0..length.lengthis assumed to be>= 0.
val check_pos_len_exn : pos:int -> len:int -> length:int -> unitRaises if
(pos, len)denotes a range outside of0..length.
val with_temporary : size:int -> f:(t -> 'a) -> 'aAllocate a bigstring and pass it to
f. The memory allocated for the bigstring is released as soon asfreturns. As such, the bigstring shouldn't be used afterfreturns.This is more efficient than waiting on the garbage collector to release the external memory.
type ('a, 'b) fold_temporary_result=|Resize of{new_size : int;state : 'a;}|Continue of{state : 'a;}Same as
Resizewith the same size|Return of 'b
val fold_temporary : size:int -> init:'a -> f:(t -> 'a -> ('a, 'b) fold_temporary_result) -> 'bSame as
with_temporary, but allow to resize the bigstring if needed.If
freturnsResize { new_size; state }, the bigstring will be resized to the given new size andfwill be called with the new bigstring andstate. The contents of the bigstring up to the min of the old and new sizes is preserved.