#![forbid(unsafe_code)]
mod be;
mod checksum;
mod commit;
mod dirmeta;
mod dirtree;
mod error;
pub mod filehdr;
mod keyfile;
mod loosepath;
mod mode;
mod objtype;
pub mod sizes;
mod valiter;
pub mod varint;
mod xattr;
pub use checksum::Checksum;
pub use commit::Commit;
pub use dirmeta::{DirMeta, DirMetaRef};
pub use dirtree::{DirTree, DirTreeRef};
pub use error::{Error, Result};
pub use filehdr::{ContentHasher, FileHeader};
pub use keyfile::KeyFile;
pub use loosepath::loose_path;
pub use mode::RepoMode;
pub use objtype::ObjectType;
pub use xattr::{Xattrs, XattrsRef};
pub use ostrya_gvariant::{Type, Value, from_bytes, to_bytes};
#[cfg(test)]
mod tests {
use ostrya_gvariant::{GvType, Type};
use crate::{Checksum, Commit, DirMeta, DirTree, FileHeader};
fn assert_pinned<T: GvType>() {
let ty = Type::parse(T::SIGNATURE).unwrap();
assert_eq!(
T::ALIGNMENT,
ty.alignment(),
"alignment for {}",
T::SIGNATURE
);
assert_eq!(
T::FIXED_SIZE,
ty.fixed_size(),
"fixed size for {}",
T::SIGNATURE
);
}
#[test]
fn object_constants_match_their_signatures() {
assert_pinned::<Checksum>();
assert_pinned::<FileHeader>();
assert_pinned::<DirMeta>();
assert_pinned::<DirTree>();
assert_pinned::<Commit>();
}
}