gix_pack/data/output/count/
mod.rs1use gix_hash::ObjectId;
2
3use crate::data::output::Count;
4
5#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8pub enum PackLocation {
9 NotLookedUp,
11 LookedUp(Option<crate::data::entry::Location>),
13}
14
15impl PackLocation {
16 pub fn is_none(&self) -> bool {
18 match self {
19 PackLocation::LookedUp(opt) => opt.is_none(),
20 PackLocation::NotLookedUp => unreachable!("must have been resolved"),
21 }
22 }
23 pub fn as_ref(&self) -> Option<&crate::data::entry::Location> {
25 match self {
26 PackLocation::LookedUp(opt) => opt.as_ref(),
27 PackLocation::NotLookedUp => unreachable!("must have been resolved"),
28 }
29 }
30}
31
32impl Count {
33 pub fn from_data(oid: impl Into<ObjectId>, location: Option<crate::data::entry::Location>) -> Self {
35 Count {
36 id: oid.into(),
37 entry_pack_location: PackLocation::LookedUp(location),
38 }
39 }
40}
41
42#[path = "objects/mod.rs"]
43mod objects_impl;
44pub use objects_impl::{objects, objects_unthreaded};
45
46pub mod objects {
48 pub use super::objects_impl::{Error, ObjectExpansion, Options, Outcome};
49}