Skip to content

Commit c32850d

Browse files
committed
some more docs for 'pack' module
1 parent 3e39e74 commit c32850d

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

git-odb/src/loose/db/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use git_object::{borrowed, HashKind};
22
use std::path::PathBuf;
33

4+
/// A database for reading and writing objects to disk, one file per object.
45
pub struct Db {
56
pub path: PathBuf,
67
}

git-odb/src/pack/bundle/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ pub enum Error {
1717
Index(#[from] pack::index::init::Error),
1818
}
1919

20-
/// A packfile with an index
20+
/// A bundle of pack data and the corresponding pack index
2121
pub struct Bundle {
2222
pub pack: pack::data::File,
2323
pub index: pack::index::File,
2424
}
2525

26+
/// Initialization
2627
impl Bundle {
27-
/// `path` is either a pack file or an index file
28+
/// Create a `Bundle` from `path`, which is either a pack file _(*.pack)_ or an index file _(*.idx)_.
29+
///
30+
/// The corresponding complementary file is expected to be present.
2831
pub fn at(path: impl AsRef<Path>) -> Result<Self, Error> {
2932
Self::try_from(path.as_ref())
3033
}

git-odb/src/pack/bundle/write/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ mod types;
1616
pub use types::Outcome;
1717
use types::PassThrough;
1818

19+
/// Configuration for [write_stream_to_directory][pack::Bundle::write_stream_to_directory()] or
20+
/// [write_to_directory_eagerly][pack::Bundle::write_to_directory_eagerly()]
1921
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
2022
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
2123
pub struct Options {

git-odb/src/pack/bundle/write/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use crate::pack;
22
use std::{io, path::PathBuf, sync::Arc};
33
use tempfile::NamedTempFile;
44

5+
/// Returned by [write_stream_to_directory][pack::Bundle::write_stream_to_directory()] or
6+
/// [write_to_directory_eagerly][pack::Bundle::write_to_directory_eagerly()]
57
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
68
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
79
pub struct Outcome {

git-odb/src/pack/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Handle packs and pack indices
12
pub mod bundle;
23
pub mod cache;
34
pub mod data;

0 commit comments

Comments
 (0)