@@ -134,6 +134,17 @@ module type RO = sig
134134 The result is [Error (`Value_expected k)] if [k] refers to a
135135 dictionary in [t]. *)
136136
137+ val get_partial : t -> key -> offset :int -> length :int -> (string , error ) result Lwt .t
138+ (* * [get_partial t k ~offset ~length] is the [length] bytes wide value
139+ bound at [offset] of [k] in [t].
140+
141+ If the size of [k] is less than [offset], [get_partial] returns an
142+ empty string.
143+ If the size of [k] is less than [offset]+[length], [get_partial]
144+ returns a short string.
145+ The result is [Error (`Value_expected k)] if [k] refers to a
146+ dictionary in [t]. *)
147+
137148 val list : t -> key -> ((string * [`Value | `Dictionary ]) list , error ) result Lwt .t
138149 (* * [list t k] is the list of entries and their types in the
139150 dictionary referenced by [k] in [t].
@@ -161,6 +172,10 @@ module type RO = sig
161172 When the value bound to [k] is a dictionary, the digest is a
162173 unique and deterministic digest of its entries. *)
163174
175+ val size : t -> key -> (int , error ) result Lwt .t
176+ (* * [size t k] is the size of [k] in [t]. *)
177+
178+
164179end
165180
166181type write_error = [
@@ -199,6 +214,19 @@ module type RW = sig
199214 {!batch} operation, where durability will be guaranteed at the
200215 end of the batch. *)
201216
217+ val set_partial : t -> key -> offset :int -> string -> (unit , write_error ) result Lwt .t
218+ (* * [set_partial t k offset v] attempts to write [v] at [offset] in the
219+ value bound to [k] in [t].
220+ If [k] contains directories that do not exist, [set_partial] will
221+ attempt to create them.
222+ If the size of [k] is less than [offset], [set_partial] appends [v]
223+ at the end of [k].
224+ If the size of [k] is greater than [offset]+length of [v],
225+ [set_partial] leaves the last bytes of [k] unchanged.
226+
227+ The result is [Error (`Value_expected k)] if [k] refers to a
228+ dictionary in [t]. *)
229+
202230 val remove : t -> key -> (unit , write_error ) result Lwt .t
203231 (* * [remove t k] removes any binding of [k] in [t]. If [k] was bound
204232 to a dictionary, the full dictionary will be removed.
@@ -207,6 +235,19 @@ module type RW = sig
207235 enclosing {!batch} operation, where durability will be guaranteed
208236 at the end of the batch. *)
209237
238+ val rename : t -> source :key -> dest :key -> (unit , write_error ) result Lwt .t
239+ (* * [rename t source dest] rename [source] to [dest] in [t].
240+ If [source] and [dest] are both bound to values in [t], [dest]
241+ is removed and the binding of [source] is moved to [dest].
242+ If [dest] is bound to a dictionary in [t], [source] is moved
243+ inside [dest]. If [source] is bound to a dictionary, the full
244+ dictionary is moved.
245+
246+ The result is [Error (`Not_found source)] if [source] does not
247+ exists in [t].
248+ The result is [Error (`Value_expected source)] if [source] is
249+ bound to a dictionary in [t] and [dest] is bound to a value in [t]. *)
250+
210251 val batch : t -> ?retries : int -> (t -> 'a Lwt .t ) -> 'a Lwt .t
211252 (* * [batch t f] run [f] in batch. Ensure the durability of
212253 operations.
0 commit comments