···117- `mst node` (DAG-CBOR): object with the following schema
118 - `l` (hash link, optional): reference to a subtree at a lower depth containing only keys to the left of this node. if absent, there is no left subtree.
119 - `L` (bool, optional): "archived": if `true`, the subtree is contained in this archive. must not be present when `l` is not present.
120- - `e` (array, required): ordered array of entry objects with length of at least one, each containing:
121 - `p` (integer, required): number of bytes shared with the previous entry (TODO [key compression](https://www.ietf.org/archive/id/draft-holmgren-at-repository-00.html#name-mst-node-schema) actually)
122 - `k` (byte string, required): key suffix remaining
123 - `v` (hash link, optional): reference to the record data for this key.
···117- `mst node` (DAG-CBOR): object with the following schema
118 - `l` (hash link, optional): reference to a subtree at a lower depth containing only keys to the left of this node. if absent, there is no left subtree.
119 - `L` (bool, optional): "archived": if `true`, the subtree is contained in this archive. must not be present when `l` is not present.
120+ - `e` (array, required): ordered array of entry objects, each containing:
121 - `p` (integer, required): number of bytes shared with the previous entry (TODO [key compression](https://www.ietf.org/archive/id/draft-holmgren-at-repository-00.html#name-mst-node-schema) actually)
122 - `k` (byte string, required): key suffix remaining
123 - `v` (hash link, optional): reference to the record data for this key.
+3-1
src/lib.rs
···2pub mod parser;
3pub mod ser;
4pub mod types;
056#[cfg(feature = "blocking")]
7pub mod blocking;
···1112pub use error::{Result, StarError};
13pub use parser::StarParser;
14-pub use ser::StarEncoder;
15pub use types::{RepoMstEntry, RepoMstNode, StarCommit, StarItem, StarMstEntry, StarMstNode};
01617#[cfg(feature = "blocking")]
18pub use blocking::StarIterator;
···2pub mod parser;
3pub mod ser;
4pub mod types;
5+pub mod validation;
67#[cfg(feature = "blocking")]
8pub mod blocking;
···1213pub use error::{Result, StarError};
14pub use parser::StarParser;
15+pub use ser::{StarEncoder, StarSerializer};
16pub use types::{RepoMstEntry, RepoMstNode, StarCommit, StarItem, StarMstEntry, StarMstNode};
17+pub use validation::StarValidator;
1819#[cfg(feature = "blocking")]
20pub use blocking::StarIterator;
-2
src/parser.rs
···247 let mut key = if e.p as usize <= prev_key_bytes.len() {
248 prev_key_bytes[..e.p as usize].to_vec()
249 } else {
250- // If prefix len > prev key len, invalid compression
251- // Although spec says "shared prefix bytes", usually <= prev.len()
252 prev_key_bytes.clone()
253 };
254 key.extend_from_slice(&e.k);
···247 let mut key = if e.p as usize <= prev_key_bytes.len() {
248 prev_key_bytes[..e.p as usize].to_vec()
249 } else {
00250 prev_key_bytes.clone()
251 };
252 key.extend_from_slice(&e.k);