File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ pub enum Error {
10
10
11
11
/// Iteration and traversal
12
12
impl Db {
13
+ /// Return an iterator over all objects contained in the database.
14
+ ///
15
+ /// The [`Id`][owned::Id]s returned by the iterator can typically be used in the [`locate(…)`][Db::locate()] method.
16
+ /// _Note_ that the result is not sorted or stable, thus ordering can change between runs.
13
17
pub fn iter ( & self ) -> impl Iterator < Item = Result < owned:: Id , Error > > {
14
18
use std:: path:: Component :: Normal ;
15
19
WalkDir :: new ( & self . path )
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ pub struct Db {
9
9
impl Db {
10
10
/// Initialize the Db with the `objects_directory` containing the hexadecimal first byte subdirectories, which in turn
11
11
/// contain all loose objects.
12
+ ///
13
+ /// In a git repository, this would be `.git/objects`.
12
14
pub fn at ( objects_directory : impl Into < PathBuf > ) -> Db {
13
15
Db {
14
16
path : objects_directory. into ( ) ,
You can’t perform that action at this time.
0 commit comments