pub struct FileSystem { /* private fields */ }
Expand description

A file system change store.

Implementations§

source§

impl FileSystem

source

pub fn filename(&self, hash: &Hash) -> PathBuf

source

pub fn tag_filename(&self, hash: &Merkle) -> PathBuf

source

pub fn has_change(&self, hash: &Hash) -> bool

source

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).

source

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).

source

pub fn save_from_buf( &self, buf: &[u8], hash: &Hash, change_id: Option<ChangeId> ) -> Result<(), ChangeError>

source

pub fn save_from_buf_unchecked( &self, buf: &[u8], hash: &Hash, change_id: Option<ChangeId> ) -> Result<(), Error>

Trait Implementations§

source§

impl ChangeStore for FileSystem

§

type Error = Error

source§

fn has_contents(&self, hash: Hash, change_id: Option<ChangeId>) -> bool

source§

fn get_header(&self, h: &Hash) -> Result<ChangeHeader, Self::Error>

source§

fn get_tag_header(&self, h: &Merkle) -> Result<ChangeHeader, Self::Error>

source§

fn get_contents<F: Fn(ChangeId) -> Option<Hash>>( &self, hash: F, key: Vertex<ChangeId>, buf: &mut [u8] ) -> Result<usize, Self::Error>

source§

fn get_contents_ext( &self, key: Vertex<Option<Hash>>, buf: &mut [u8] ) -> Result<usize, Self::Error>

source§

fn change_deletes_position<F: Fn(ChangeId) -> Option<Hash>>( &self, hash: F, change: ChangeId, pos: Position<Option<Hash>> ) -> Result<Vec<Hash>, Self::Error>

source§

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>

source§

fn del_change(&self, hash: &Hash) -> Result<bool, Self::Error>

source§

fn get_change(&self, h: &Hash) -> Result<Change, Self::Error>

source§

fn get_dependencies(&self, hash: &Hash) -> Result<Vec<Hash>, Self::Error>

source§

fn get_extra_known(&self, hash: &Hash) -> Result<Vec<Hash>, Self::Error>

source§

fn get_changes( &self, hash: &Hash ) -> Result<Vec<Hunk<Option<Hash>, Local>>, Self::Error>

source§

fn knows(&self, hash0: &Hash, hash1: &Hash) -> Result<bool, Self::Error>

source§

fn has_edge( &self, change: Hash, from: Position<Option<Hash>>, to: Position<Option<Hash>>, flags: EdgeFlags ) -> Result<bool, Self::Error>

source§

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>

source§

impl Clone for FileSystem

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V