rustybit_lib/
torrent_meta.rs

1#[derive(Debug, Clone)]
2pub struct TorrentMeta {
3    pub info_hash: [u8; 20],
4    pub piece_size: usize,
5    pub number_of_pieces: usize,
6    pub total_length: usize,
7}
8
9impl TorrentMeta {
10    pub fn new(info_hash: [u8; 20], piece_size: usize, total_length: usize, number_of_pieces: usize) -> Self {
11        TorrentMeta {
12            info_hash,
13            piece_size,
14            number_of_pieces,
15            total_length,
16        }
17    }
18}