1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Borrowed objects are expected to be deserialized from bytes that acts as backing store, and they
//! can not be serialized directly. Instead, one will convert them into their `owned` counterparts,
//! which support serialization.
mod commit;
pub use commit::Commit;

mod id;
pub use id::*;

mod tag;
pub use tag::Tag;

pub mod tree;
#[doc(inline)]
pub use tree::Tree;

mod blob {
    use std::convert::Infallible;

    #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
    #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
    pub struct Blob<'a> {
        pub data: &'a [u8],
    }

    impl<'a> Blob<'a> {
        pub fn from_bytes(input: &[u8]) -> Result<Blob, Infallible> {
            Ok(Blob { data: input })
        }
    }
}

pub use blob::Blob;

mod object;
pub use object::*;

mod parse;