rectangle-device-blocks 0.1.0

IPFS block formatting for an experimental decentralizable live video server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::core::{Block, Cid, PbLink};

pub trait Package {
    type BlockIterator: Iterator<Item=Block>;

    fn cid(&self) -> &Cid;
    fn total_size(&self) -> u64;
    fn into_blocks(self) -> Self::BlockIterator;

    fn link(&self, name: String) -> PbLink {
        PbLink {
            cid: self.cid().clone(),
            size: self.total_size(),
            name
        }
    }
}