| ... | ... | @@ -214,10 +214,7 @@ pub const Options = struct { |
| 214 | 214 | ignore_unknown_fields: bool = false, |
| 215 | 215 | }; |
| 216 | 216 | |
| 217 | | /// Parses the given slice as ZON. |
| 218 | | /// |
| 219 | | /// Human readable errors are written to `options.errors`. `options.arena` owns the errors, and any |
| 220 | | /// pointers that are part of `T`. |
| 217 | /// Parses the given slice as ZON, writing any errors to `options.errors`. |
| 221 | 218 | pub fn fromSlice(T: type, options: Options) error{ OutOfMemory, ParseZon }!T { |
| 222 | 219 | var value: T = undefined; |
| 223 | 220 | try fromSliceInner(T, &value, false, options); |
| ... | ... | @@ -269,11 +266,12 @@ pub fn fromSliceNoAlloc(T: type, options: Options) error{ OutOfMemory, ParseZon |
| 269 | 266 | return fromSlice(T, options); |
| 270 | 267 | } |
| 271 | 268 | |
| 272 | | /// Similar to `fromSlice`, but updates `value` in place. `value` must be initialized before this |
| 273 | | /// call, fields not specified in ZON are left unchanged. |
| 269 | /// Similar to `fromSlice`, but updates the existing contents of `value` in place. Fields |
| 270 | /// unspecified by ZON are left unchanged. |
| 274 | 271 | /// |
| 275 | | /// Whenever a slice or an untagged union is specified, it completely overwites the previous value. |
| 276 | | /// On error, `value` remains valid, but may be partially updated. |
| 272 | /// Assumes that `value` points to a fully initialized value prior to this call. Slices and untagged |
| 273 | /// unions are replaced in their entirey when specified. On error, `value` remains valid, but may be |
| 274 | /// partially updated. |
| 277 | 275 | pub fn updateFromSlice( |
| 278 | 276 | T: type, |
| 279 | 277 | value: *T, |