[][src]Struct osync::index::Index

pub struct Index { /* fields omitted */ }

Implementations

impl Index[src]

pub fn load<P: AsRef<Path>>(directory: P) -> Result<Index, Box<dyn Error>>[src]

Try to load the cached index for given directory this will either return the loaded index or a new blank one.

pub fn compute<P: AsRef<Path>>(
    directory: P
) -> Result<(Index, usize), Box<dyn Error>>
[src]

Compute the index for given directory.

pub fn save(&self) -> Result<(), Box<dyn Error>>[src]

Save the index to the disk.

pub fn diff(&self, b: &Index) -> (Vec<String>, Vec<String>)[src]

Compute the difference between the indexes self & b return the changed files (new, modified) and the deleted.

pub fn len(&self) -> usize[src]

Returns the number of files in the index.

pub fn is_empty(&self) -> bool[src]

Returns true if the index contains no files.

pub fn path(&self) -> PathBuf[src]

Returns the path which the index is computed for.

pub fn files(&self) -> HashMap<String, String>[src]

Trait Implementations

impl<'a> Index<&'a str> for Index[src]

Allows you to access the index file directory with []

type Output = String

The returned type after indexing.

Auto Trait Implementations

impl RefUnwindSafe for Index

impl Send for Index

impl Sync for Index

impl Unpin for Index

impl UnwindSafe for Index

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.