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, offset_size_for, to_bytes, to_text, to_text_unannotated,
52 tuple_field_from_bytes, write_offset,
53};
54
55#[cfg(test)]
56mod tests {
57 use ostrya_gvariant::{GvType, Type};
58
59 use crate::{Checksum, Commit, DirMeta, DirTree, FileHeader};
60
61 fn assert_pinned<T: GvType>() {
64 let ty = Type::parse(T::SIGNATURE).unwrap();
65 assert_eq!(
66 T::ALIGNMENT,
67 ty.alignment(),
68 "alignment for {}",
69 T::SIGNATURE
70 );
71 assert_eq!(
72 T::FIXED_SIZE,
73 ty.fixed_size(),
74 "fixed size for {}",
75 T::SIGNATURE
76 );
77 }
78
79 #[test]
80 fn object_constants_match_their_signatures() {
81 assert_pinned::<Checksum>();
82 assert_pinned::<FileHeader>();
83 assert_pinned::<DirMeta>();
84 assert_pinned::<DirTree>();
85 assert_pinned::<Commit>();
86 }
87}