[−][src]Struct rrsync::IndexTransaction
A transaction on the index, for safety and performance
Methods
impl<'a> IndexTransaction<'a>
[src]
pub fn add_file(
&mut self,
name: &Path,
modified: DateTime<Utc>
) -> Result<(u32, bool), Error>
[src]
&mut self,
name: &Path,
modified: DateTime<Utc>
) -> Result<(u32, bool), Error>
Add a file to the index
This returns a tuple (file_id, up_to_date)
where file_id
can be
used to insert blocks, and up_to_date
indicates whether the file's
modification date has changed and it should be re-indexed.
pub fn add_file_overwrite(
&mut self,
name: &Path,
modified: DateTime<Utc>
) -> Result<u32, Error>
[src]
&mut self,
name: &Path,
modified: DateTime<Utc>
) -> Result<u32, Error>
Replace file in the index
This is like add_file but will always replace an existing file.
pub fn remove_file(&mut self, file_id: u32) -> Result<(), Error>
[src]
Remove a file and all its blocks from the index
pub fn move_file(
&mut self,
file_id: u32,
destination: &Path
) -> Result<(), Error>
[src]
&mut self,
file_id: u32,
destination: &Path
) -> Result<(), Error>
Move a file, possibly over another
pub fn list_files(&self) -> Result<Vec<(u32, PathBuf, DateTime<Utc>)>, Error>
[src]
Get a list of all the files in the index
pub fn add_block(
&mut self,
hash: &HashDigest,
file_id: u32,
offset: usize,
size: usize
) -> Result<(), Error>
[src]
&mut self,
hash: &HashDigest,
file_id: u32,
offset: usize,
size: usize
) -> Result<(), Error>
Add a block to the index
pub fn list_file_blocks(
&self,
file_id: u32
) -> Result<Vec<(HashDigest, usize, usize)>, Error>
[src]
&self,
file_id: u32
) -> Result<Vec<(HashDigest, usize, usize)>, Error>
Get a list of all the blocks in a specific file
pub fn get_block(
&self,
hash: &HashDigest
) -> Result<Option<(PathBuf, usize, usize)>, Error>
[src]
&self,
hash: &HashDigest
) -> Result<Option<(PathBuf, usize, usize)>, Error>
Try to find a block in the indexed files
pub fn index_file(&mut self, path: &Path, name: &Path) -> Result<(), Error>
[src]
Cut up a file into blocks and add them to the index
pub fn index_path(&mut self, path: &Path) -> Result<(), Error>
[src]
Index files and directories recursively
pub fn remove_missing_files(&mut self, path: &Path) -> Result<(), Error>
[src]
List all files and remove those that don't exist on disk
pub fn commit(self) -> Result<(), Error>
[src]
Commit the transaction
Auto Trait Implementations
impl<'a> !Send for IndexTransaction<'a>
impl<'a> !Sync for IndexTransaction<'a>
impl<'a> Unpin for IndexTransaction<'a>
impl<'a> !UnwindSafe for IndexTransaction<'a>
impl<'a> !RefUnwindSafe for IndexTransaction<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,