Struct libpijul::changestore::filesystem::FileSystem
source · pub struct FileSystem { /* private fields */ }
Expand description
A file system change store.
Implementations§
source§impl FileSystem
impl FileSystem
pub fn filename(&self, hash: &Hash) -> PathBuf
pub fn tag_filename(&self, hash: &Merkle) -> PathBuf
pub fn has_change(&self, hash: &Hash) -> bool
sourcepub fn from_root<P: AsRef<Path>>(root: P, cap: usize) -> Self
pub fn from_root<P: AsRef<Path>>(root: P, cap: usize) -> Self
Construct a FileSystem
, starting from the root of the
repository (i.e. the parent of the .pijul
directory).
sourcepub fn from_changes(changes_dir: PathBuf, cap: usize) -> Self
pub fn from_changes(changes_dir: PathBuf, cap: usize) -> Self
Construct a FileSystem
, starting from the root of the
repository (i.e. the parent of the .pijul
directory).
pub fn save_from_buf( &self, buf: &[u8], hash: &Hash, change_id: Option<ChangeId> ) -> Result<(), ChangeError>
pub fn save_from_buf_unchecked( &self, buf: &[u8], hash: &Hash, change_id: Option<ChangeId> ) -> Result<(), Error>
Trait Implementations§
source§impl ChangeStore for FileSystem
impl ChangeStore for FileSystem
type Error = Error
fn has_contents(&self, hash: Hash, change_id: Option<ChangeId>) -> bool
fn get_header(&self, h: &Hash) -> Result<ChangeHeader, Self::Error>
fn get_tag_header(&self, h: &Merkle) -> Result<ChangeHeader, Self::Error>
fn get_contents<F: Fn(ChangeId) -> Option<Hash>>( &self, hash: F, key: Vertex<ChangeId>, buf: &mut [u8] ) -> Result<usize, Self::Error>
fn get_contents_ext( &self, key: Vertex<Option<Hash>>, buf: &mut [u8] ) -> Result<usize, Self::Error>
fn change_deletes_position<F: Fn(ChangeId) -> Option<Hash>>( &self, hash: F, change: ChangeId, pos: Position<Option<Hash>> ) -> Result<Vec<Hash>, Self::Error>
fn save_change<E: From<Self::Error> + From<ChangeError>, F: FnOnce(&mut Change, &Hash) -> Result<(), E>>( &self, p: &mut Change, ff: F ) -> Result<Hash, E>
fn del_change(&self, hash: &Hash) -> Result<bool, Self::Error>
fn get_change(&self, h: &Hash) -> Result<Change, Self::Error>
fn get_dependencies(&self, hash: &Hash) -> Result<Vec<Hash>, Self::Error>
fn get_extra_known(&self, hash: &Hash) -> Result<Vec<Hash>, Self::Error>
fn get_changes( &self, hash: &Hash ) -> Result<Vec<Hunk<Option<Hash>, Local>>, Self::Error>
fn knows(&self, hash0: &Hash, hash1: &Hash) -> Result<bool, Self::Error>
fn has_edge( &self, change: Hash, from: Position<Option<Hash>>, to: Position<Option<Hash>>, flags: EdgeFlags ) -> Result<bool, Self::Error>
fn get_file_meta<'a, F: Fn(ChangeId) -> Option<Hash>>( &self, hash: F, vertex: Vertex<ChangeId>, buf: &'a mut [u8] ) -> Result<FileMetadata<'a>, Self::Error>
Auto Trait Implementations§
impl !RefUnwindSafe for FileSystem
impl Send for FileSystem
impl !Sync for FileSystem
impl Unpin for FileSystem
impl UnwindSafe for FileSystem
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more