@@ -8,7 +8,7 @@ use std::{
88 fmt:: Display ,
99 io:: { Read , Seek } ,
1010} ;
11- use xxhash_rust:: xxh3:: xxh3_64;
11+ use xxhash_rust:: { xxh3:: xxh3_64, xxh64 :: xxh64 } ;
1212
1313mod builder;
1414mod chunk;
@@ -39,21 +39,22 @@ pub struct Modpkg<TSource: Read + Seek + Default> {
3939 layer_count : u32 ,
4040 #[ br( count = layer_count, map = |m: Vec <ModpkgLayer >| m. into_iter( ) . map( |c| ( xxh3_64( c. name. as_bytes( ) ) , c) ) . collect( ) ) ]
4141 #[ bw( map = |m| m. values( ) . cloned( ) . collect_vec( ) ) ]
42- layers : HashMap < u64 , ModpkgLayer > ,
42+ pub layers : HashMap < u64 , ModpkgLayer > ,
4343
4444 #[ br( temp) ]
4545 #[ bw( calc = chunk_paths. len( ) as u32 ) ]
4646 chunk_path_count : u32 ,
47- #[ br( count = chunk_path_count) ]
48- chunk_paths : Vec < NullString > ,
47+ #[ br( count = chunk_path_count, map = |m: Vec <NullString >| m. into_iter( ) . map( |c| ( xxh64( & c. 0 , 0 ) , c) ) . collect( ) ) ]
48+ #[ bw( map = |m| m. values( ) . cloned( ) . collect_vec( ) ) ]
49+ pub chunk_paths : HashMap < u64 , NullString > ,
4950
50- metadata : ModpkgMetadata ,
51+ pub metadata : ModpkgMetadata ,
5152
5253 // alan: pretty sure this works to align the individual chunks - https://github.com/jam1garner/binrw/issues/68
5354 #[ brw( align_before = 8 ) ]
5455 #[ br( count = chunk_count, map = |m: Vec <ModpkgChunk >| m. into_iter( ) . map( |c| ( c. path_hash, c) ) . collect( ) ) ]
5556 #[ bw( map = |m| m. values( ) . copied( ) . collect_vec( ) ) ]
56- chunks : HashMap < u64 , ModpkgChunk > ,
57+ pub chunks : HashMap < u64 , ModpkgChunk > ,
5758
5859 #[ brw( ignore) ]
5960 /// The original byte source.
0 commit comments