1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Other Resources
//!
//! - Source code - [github.com/pjkundert/zome-labeled-data](https://github.com/pjkundert/zome-labeled-data)
//! - Cargo package - [crates.io/crates/byte_blocks_types](https://crates.io/crates/byte_blocks_types)
//!
pub use hdi;
use *;
//
// Memory Entry
//
/// An Entry that represents a full byte-set by grouping a set of MemoryBlockEntry
///
/// Example values
/// ```
/// # use std::convert::TryFrom;
/// # use holo_hash::{ EntryHash };
/// use byte_blocks_types::{ MemoryEntry };
///
/// MemoryEntry {
/// hash: "bdff630d3f1c11ef".to_string(),
/// compression: None,
/// uncompressed_size: None,
/// memory_size: 712837,
/// block_addresses: vec![
/// EntryHash::try_from("uhCEkBh2fW3K2RE41X3MOO3LdrMUYPPXWPGtuDjwRrXQZk-94N7Ku").unwrap(),
/// ],
/// };
/// ```
//
// Memory Block Entry
//
/// Indicates where a memory block fits in a byte-set
///
/// Example (indicating block 1 of a 2 block set)
/// ```
/// use byte_blocks_types::SequencePosition;
///
/// SequencePosition {
/// position: 1, // Indexing is intended to start at 1, not 0
/// length: 2,
/// };
/// ```
/// An Entry that contains 1 part of a MemoryEntry byte-set
///
/// Example
/// ```
/// use byte_blocks_types::{ MemoryBlockEntry, SequencePosition };
///
/// MemoryBlockEntry {
/// sequence: SequencePosition {
/// position: 1, // Indexing is intended to start at 1, not 0
/// length: 2,
/// },
/// bytes: vec![ 34, 129, 87, 2 ],
/// };
/// ```