Trait flechasdb::io::FileSystem
source · pub trait FileSystem {
type HashedFileOut: HashedFileOut;
type HashedFileIn: HashedFileIn;
// Required methods
fn create_hashed_file(&self) -> Result<Self::HashedFileOut, Error>;
fn create_hashed_file_in(
&self,
path: impl AsRef<str>
) -> Result<Self::HashedFileOut, Error>;
fn open_hashed_file(
&self,
path: impl AsRef<str>
) -> Result<Self::HashedFileIn, Error>;
// Provided methods
fn create_compressed_hashed_file(
&self
) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error> { ... }
fn create_compressed_hashed_file_in(
&self,
path: impl AsRef<str>
) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error> { ... }
fn open_compressed_hashed_file(
&self,
path: impl AsRef<str>
) -> Result<CompressedHashedFileIn<Self::HashedFileIn>, Error> { ... }
}Expand description
Abstracts a file system.
Required Associated Types§
sourcetype HashedFileOut: HashedFileOut
type HashedFileOut: HashedFileOut
File that calculates the hash of its contents.
sourcetype HashedFileIn: HashedFileIn
type HashedFileIn: HashedFileIn
File whose contents can be verified with the hash.
Required Methods§
sourcefn create_hashed_file(&self) -> Result<Self::HashedFileOut, Error>
fn create_hashed_file(&self) -> Result<Self::HashedFileOut, Error>
Creates a file that calculates the hash of its contents.
sourcefn create_hashed_file_in(
&self,
path: impl AsRef<str>
) -> Result<Self::HashedFileOut, Error>
fn create_hashed_file_in( &self, path: impl AsRef<str> ) -> Result<Self::HashedFileOut, Error>
Creates a hashed file in a given directory.
sourcefn open_hashed_file(
&self,
path: impl AsRef<str>
) -> Result<Self::HashedFileIn, Error>
fn open_hashed_file( &self, path: impl AsRef<str> ) -> Result<Self::HashedFileIn, Error>
Opens a file whose contents can be verified with a hash.
Provided Methods§
sourcefn create_compressed_hashed_file(
&self
) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error>
fn create_compressed_hashed_file( &self ) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error>
Creates a compressed file that calculates the hash of its contents.
sourcefn create_compressed_hashed_file_in(
&self,
path: impl AsRef<str>
) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error>
fn create_compressed_hashed_file_in( &self, path: impl AsRef<str> ) -> Result<CompressedHashedFileOut<Self::HashedFileOut>, Error>
Creates a compressed hashed file in a given directory.
sourcefn open_compressed_hashed_file(
&self,
path: impl AsRef<str>
) -> Result<CompressedHashedFileIn<Self::HashedFileIn>, Error>
fn open_compressed_hashed_file( &self, path: impl AsRef<str> ) -> Result<CompressedHashedFileIn<Self::HashedFileIn>, Error>
Opens a compressed file whose contents can be verified with a hash.