pub struct Manifest { /* private fields */ }Expand description
A slice manifest (15.13, spec-0.4.0): {"members": [...], "slice": {...}}, the member
receipt hashes (ascending, unique, at most 1,048,576) and the slice object. It is fetched
by its entry slice:<slice id>:<members hash>, where the members hash is SHA-256 of the
canonical bytes of the members array (of [] for an empty slice).
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn from_json(bytes: &[u8]) -> Result<Manifest>
pub fn from_json(bytes: &[u8]) -> Result<Manifest>
Parses a manifest from JSON text: strict JSON; structure (E_SCHEMA) over the whole
manifest, the slice object’s included; then the members (E_CANON_HEX for each, then
E_CANON_SET for their order, then E_CANON_LIMIT), then the slice object (see
Slice::from_json).
Sourcepub fn from_value(v: &Value) -> Result<Manifest>
pub fn from_value(v: &Value) -> Result<Manifest>
Checks a parsed JSON value as a manifest.
Sourcepub fn new(slice: Slice, members: Vec<String>) -> Result<Manifest>
pub fn new(slice: Slice, members: Vec<String>) -> Result<Manifest>
The manifest of slice with members (receipt hashes), checked as
from_json checks them: each 64 lowercase hex digits
(E_CANON_HEX), strictly ascending (E_CANON_SET), at most 1,048,576
(E_CANON_LIMIT).
Sourcepub fn members_hash(&self) -> &str
pub fn members_hash(&self) -> &str
SHA-256 of the canonical bytes of the members array, lowercase hex.