Struct rif::rel::Relations[][src]

pub struct Relations {
    pub files: HashMap<PathBuf, SingleFile>,
}
Expand description

Relations is a struct that stores all information about rif

Fields

files: HashMap<PathBuf, SingleFile>

Implementations

Display a single file as human readable form

Args

  • path - A file path(name) to display

Display format

> <FILE_NAME> | [REFS]

Only display stale files

Print a single file’s relation

Args

  • path - File name to print
  • depth - Desired depth value to display

Print rif relation tree with given nested level

Args

  • depth - Desired depth value to display

Add file to rif list

Fails when path doesn’t exist. Sanity is checked after addition.

Args

  • file_path - A file path to add

Remove file from rif

Path validity doesn’t matter.

Args

  • file_path - File path(name) to remove from rif.

Rename a file in rif

This operation require new_name path does exists and doesn’t check path of old_name

Args

  • file_path - File path(name) to rename.
  • new_name - New file name to apply

Update filestamp of file

Update file’s timestamp and last modified time into file’s system last modified time.

Args

  • file_path - File path(name) to update timestamp

Forcefully update filestamp of file

Update file’s timestamp into current unix time.

Args

  • file_path - File path(name) to update timestamp

Discard file modification

Retain file’s timestamp and only update last modified time.

Args

  • file_path - File path(name) to discard modification

Set references to a file

This is union operation thus existing files are not affected. References should be existent in rif list to be added to a file.

Args

  • file_path - File path(name) to add references
  • ref_files - File pahts to set as references

Unset references from a file

This is minus operation thus references don’t have to be valid path.

Args

  • file_path - File path(name) to discard modification
  • ref_files - File pahts to unset as references

Set status for a file

Args

  • file_path - File path(name) to set a status
  • file_status - File status to set for the file

Check sanity of rif list

Sanity is assured when: file is not referencing itself, file referencing conclues to infinite loop

Fix invalid format so that sanity can be retained.

Repeatedly find invalid referecning and fix until sanity check succeeds.

Track and print modified files

Modfication is determined by comparing rif’s last modified and system’s modifid time. If rif’s last modified time is oldere than system’s modified time, it is considered as modified.

Get list of modified files

Logic is very similar to track_modified_files but it returns list of modified files.

Track and display unregistered files

Unregistered file is a file which exists in under directory where rif file resides.

Args

  • black_list - Blacklists to to ignore when tracking unregistered files

Read rif file and return rif list

Read rif file without sanity check

Save rif list into rif file

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.