1pub mod existing {
3 use git_hash::ObjectId;
4
5 #[derive(Debug, thiserror::Error)]
7 #[allow(missing_docs)]
8 pub enum Error<T: std::error::Error + 'static> {
9 #[error(transparent)]
10 Find(T),
11 #[error("An object with id {} could not be found", .oid)]
12 NotFound { oid: ObjectId },
13 }
14}
15
16pub mod existing_object {
18 use git_hash::ObjectId;
19
20 #[derive(Debug, thiserror::Error)]
22 #[allow(missing_docs)]
23 pub enum Error<T: std::error::Error + 'static> {
24 #[error(transparent)]
25 Find(T),
26 #[error(transparent)]
27 Decode(git_object::decode::Error),
28 #[error("An object with id {} could not be found", .oid)]
29 NotFound { oid: ObjectId },
30 #[error("Expected object of kind {} something else", .expected)]
31 ObjectKind { expected: git_object::Kind },
32 }
33}
34
35pub mod existing_iter {
37 use git_hash::ObjectId;
38
39 #[derive(Debug, thiserror::Error)]
41 #[allow(missing_docs)]
42 pub enum Error<T: std::error::Error + 'static> {
43 #[error(transparent)]
44 Find(T),
45 #[error("An object with id {} could not be found", .oid)]
46 NotFound { oid: ObjectId },
47 #[error("Expected object of kind {} something else", .expected)]
48 ObjectKind { expected: git_object::Kind },
49 }
50}
51
52#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
56#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
57#[allow(missing_docs)]
58pub struct Entry {
59 pub data: Vec<u8>,
61 pub version: crate::data::Version,
63}