1#![forbid(unsafe_code)]
2
3pub mod base64;
16mod be;
17mod checksum;
18mod commit;
19mod dirmeta;
20mod dirtree;
21mod error;
22pub mod filehdr;
23mod keyfile;
24mod loosepath;
25mod mode;
26mod objname;
27mod objtype;
28pub mod sizes;
29mod valiter;
30pub mod varint;
31mod xattr;
32
33pub use checksum::Checksum;
34pub use commit::Commit;
35pub use dirmeta::{DirMeta, DirMetaRef};
36pub use dirtree::{DirTree, DirTreeRef};
37pub use error::{Error, Result};
38pub use filehdr::{ContentHasher, FileHeader};
39pub use keyfile::KeyFile;
40pub use loosepath::loose_path;
41pub use mode::RepoMode;
42pub use objname::ObjectName;
43pub use objtype::ObjectType;
44pub use xattr::{Xattrs, XattrsRef};
45
46pub use ostrya_gvariant::{
50 ArrayIter, DictBuilder, GvDecode, GvType, Span, TextError, Type, Value, choose_offset_size,
51 from_bytes, from_text, to_bytes, to_text, to_text_unannotated, write_offset,
52};
53
54#[cfg(test)]
55mod tests {
56 use ostrya_gvariant::{GvType, Type};
57
58 use crate::{Checksum, Commit, DirMeta, DirTree, FileHeader};
59
60 fn assert_pinned<T: GvType>() {
63 let ty = Type::parse(T::SIGNATURE).unwrap();
64 assert_eq!(
65 T::ALIGNMENT,
66 ty.alignment(),
67 "alignment for {}",
68 T::SIGNATURE
69 );
70 assert_eq!(
71 T::FIXED_SIZE,
72 ty.fixed_size(),
73 "fixed size for {}",
74 T::SIGNATURE
75 );
76 }
77
78 #[test]
79 fn object_constants_match_their_signatures() {
80 assert_pinned::<Checksum>();
81 assert_pinned::<FileHeader>();
82 assert_pinned::<DirMeta>();
83 assert_pinned::<DirTree>();
84 assert_pinned::<Commit>();
85 }
86}