pub fn new_with_root(path: &OpenType) -> anyhow::Result<Self> {
        let (conn, inner) = match path {
            OpenType::Dir(path) => {
                std::fs::create_dir_all(path)?;
                std::fs::create_dir_all(path.join(DATA_INNER_ROOT))?;

                (
                    sled::Config::new()
                        .use_compression(true)
                        .mode(sled::Mode::HighThroughput)
                        .path(path.join(METASTORE_INNER_ROOT))
                        .open()?,
                    MmapDirectory::open(path.join(DATA_INNER_ROOT))?,
                )
            },
            OpenType::TempFile => (
                sled::Config::new()
                    .use_compression(true)
                    .mode(sled::Mode::HighThroughput)
                    .temporary(true)
                    .open()?,
                MmapDirectory::create_from_tempdir()?,
            ),
        };

        Ok(Self { inner, conn })
    }
/// Creates or opens the given path.
///
/// If OpenType::Dir(p) is set the system will ensure the directories are
/// created and ensured.
///
/// If OpenType::TempFile is set the system will create a temporary structure,
/// normally for testing.
Creates or opens the given path.
If OpenType::Dir(p) is set the system will ensure the directories are
created and ensured.

If OpenType::TempFile is set the system will create a temporary structure,
normally for testing.
Creates or opens the given path . If OpenType :: Dir ( p ) is set the system will ensure the directories are created and ensured . If OpenType :: TempFile is set the system will create a temporary structure normally for testing .
pub fn new_with_root(path: &OpenType) -> anyhow::Result<Self> {
        let (conn, inner) = match path {
            OpenType::Dir(path) => {
                std::fs::create_dir_all(path)?;
                std::fs::create_dir_all(path.join(DATA_INNER_ROOT))?;
                (
                    sled::Config::new()
                        .use_compression(true)
                        .mode(sled::Mode::HighThroughput)
                        .path(path.join(METASTORE_INNER_ROOT))
                        .open()?,
                    MmapDirectory::open(path.join(DATA_INNER_ROOT))?,
                )
            },
            OpenType::TempFile => (
                sled::Config::new()
                    .use_compression(true)
                    .mode(sled::Mode::HighThroughput)
                    .temporary(true)
                    .open()?,
                MmapDirectory::create_from_tempdir()?,
            ),
        };
        Ok(Self { inner, conn })
    }
pub fn new_with_root ( path : & OpenType ) -> anyhow :: Result < Self > { let ( conn , inner ) = match path { OpenType :: Dir ( path ) => { std :: fs :: create_dir_all ( path ) ? ; std :: fs :: create_dir_all ( path . join ( DATA_INNER_ROOT ) ) ? ; ( sled :: Config :: new ( ) . use_compression ( true ) . mode ( sled :: Mode :: HighThroughput ) . path ( path . join ( METASTORE_INNER_ROOT ) ) . open ( ) ? , MmapDirectory :: open ( path . join ( DATA_INNER_ROOT ) ) ? , ) } , OpenType :: TempFile => ( sled :: Config :: new ( ) . use_compression ( true ) . mode ( sled :: Mode :: HighThroughput ) . temporary ( true ) . open ( ) ? , MmapDirectory :: create_from_tempdir ( ) ? , ) , } ; Ok ( Self { inner , conn } ) }
Creates or opens the given path.
Creates or opens the given path .
path
&OpenType
path
&OpenType