pub async fn open(root: impl Into<PathBuf>) -> Result<Self, Error> {
        let root = root.into();
        let tree = Tree::open(&root).await?;
        let repo = Repository::open(&root)?;

        Ok(Self { tree, repo })
    }
/// Open an existing index at the given root path.
///
/// # Example
/// ```no_run
/// use crate_index::Index;
/// # use crate_index::Error;
/// # async {
/// let root = "/index";
///
/// let index = Index::open("/index").await?;
/// # Ok::<(), Error>(())
/// # };
/// ```
///
/// # Errors
///
/// This method can return an error if the filepath doesn't exist, can't be
/// read from, or if the index is malformed.
Open an existing index at the given root path.
Open an existing index at the given root path .
pub async fn open(root: impl Into<PathBuf>) -> Result<Self, Error> {
        let root = root.into();
        let tree = Tree::open(&root).await?;
        let repo = Repository::open(&root)?;
        Ok(Self { tree, repo })
    }
pub async fn open ( root : impl Into < PathBuf > ) -> Result < Self , Error > { let root = root . into ( ) ; let tree = Tree :: open ( & root ) . await ? ; let repo = Repository :: open ( & root ) ? ; Ok ( Self { tree , repo } ) }
Open an existing index at the given root path.
Open an existing index at the given root path .
root
impl Into<PathBuf>
example
```no_run
use crate_index::Index.
` ` ` no_run use crate_index :: Index .
use crate_index::error;
None
async {
let root = "/index".

let index = Index::open("/index").await?.
let root = " / index " . let index = Index :: open ( " / index " ) . await? .
ok::<(), error>(())
None
};
None
errors
This method can return an error if the filepath doesn't exist, can't be
read from, or if the index is malformed.
This method can return an error if the filepath doesn ' t exist can ' t be read from or if the index is malformed .