pub fn open<P: AsRef<Path>>(dir: P) -> Result<Self> {
        let dir = dir.as_ref();
        let s = fs::read_to_string(dir.join("chunks/store")).map_err(|_| Error::NotFound)?;
        let version_tag = s.trim();
        if version_tag != "v2" {
            Err(Error::VersionTag(version_tag.to_owned()))
        } else {
            Ok(Self {
                dir: dir.to_owned(),
            })
        }
    }
/// Opens chunked backend store and checks store format.
///
/// # Errors
///
/// Fails with Error::NotFound or Error::VersionTag if no
/// valid version tag is present in the store directory.
Opens chunked backend store and checks store format.
Opens chunked backend store and checks store format .
pub fn open<P: AsRef<Path>>(dir: P) -> Result<Self> {
        let dir = dir.as_ref();
        let s = fs::read_to_string(dir.join("chunks/store")).map_err(|_| Error::NotFound)?;
        let version_tag = s.trim();
        if version_tag != "v2" {
            Err(Error::VersionTag(version_tag.to_owned()))
        } else {
            Ok(Self {
                dir: dir.to_owned(),
            })
        }
    }
pub fn open < P : AsRef < Path > > ( dir : P ) -> Result < Self > { let dir = dir . as_ref ( ) ; let s = fs :: read_to_string ( dir . join ( " " ) ) . map_err ( | _ | Error :: NotFound ) ? ; let version_tag = s . trim ( ) ; if version_tag != " " { Err ( Error :: VersionTag ( version_tag . to_owned ( ) ) ) } else { Ok ( Self { dir : dir . to_owned ( ) , } ) } }
Opens chunked backend store and checks store format.
Opens chunked backend store and checks store format .
dir
P
dir
P
errors
Fails with Error::NotFound or Error::VersionTag if no
valid version tag is present in the store directory.
Fails with Error :: NotFound or Error :: VersionTag if no valid version tag is present in the store directory .