File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ let[@inline] contents self = Bytes.sub_string self.bs 0 self.len
8989let [@ inline] contents_bytes self = Bytes. sub self.bs 0 self.len
9090let [@ inline] append_iter self i = i (add_char self)
9191let [@ inline] append_seq self seq = Seq. iter (add_char self) seq
92+ let [@ inline] to_slice self = CCByte_slice. create ~len: self.len self.bs
9293
9394let fold_left f acc self =
9495 let { bs; len } = self in
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ val unsafe_get : t -> int -> char
6565val set : t -> int -> char -> unit
6666val unsafe_set : t -> int -> char -> unit
6767
68+ val to_slice : t -> CCByte_slice .t
69+ (* * [to_slice buf] returns a slice of the current content.
70+ The slice shares the same byte array as [buf] (until [buf] is resized). *)
71+
6872val contents : t -> string
6973(* * Copy the internal data to a string. Allocates. *)
7074
You can’t perform that action at this time.
0 commit comments