Struct asciii::storage::Storage [] [src]

pub struct Storage<L: Storable> { /* fields omitted */ }

Manages project file storage.

This includes:

  • keeping current projects in a working directory
  • listing project folders and files
  • listing templates
  • archiving and unarchiving projects
  • git interaction

Methods

impl<L: Storable> Storage<L>
[src]

[src]

Inits storage, does not check existence, yet. TODO

[src]

Inits storage with git capabilities.

[src]

Checks whether the folder structure is as it's supposed to be.

[src]

Getter for Storage::storage.

[src]

Getter for Storage::working.

[src]

Getter for Storage::archive.

[src]

Getter for Storage::templates.

[src]

Getter for Storage::templates.

[src]

Returns a struct containing all configured paths of this Storage.

[src]

Creates the basic dir structure inside the storage directory.

└── root
    ├── archive
    ├── templates
    └── working

If the directories already exist as expected, that's fine TODO ought to fail when storage_dir already contains directories that do not correspond with the names given in this setup.

[src]

Creates an archive for a certain year. This is a subdirectory under the archive directory.

└── root
    ├── archive
        ├── 2001
    ...

[src]

Produces a list of files in the template_dir()

[src]

Produces a list of names of all template filess in the templates_dir()

[src]

Returns the Path to the template file by the given name, maybe.

[src]

Produces a list of paths to all archives in the archive_dir. An archive itself is a folder that contains project dirs, therefore it essentially has the same structure as the working_dir, with the difference, that the project folders may be prefixed with the projects index, e.g. an invoice number etc.

[src]

Produces a list of years for which there is an archive.

[src]

Takes a template file and stores it in the working directory, in a new project directory according to it's name.

[src]

Moves a project folder from /working dir to /archive/$year. Also adds the project.prefix() to the folder name.

└── root
    ├── archive
        ├── 2001
            ├── R0815_Birthdayparty
    ...

[src]

Moves projects found through search_terms from the Working directory to the Archive/year directory.

Returns list of old and new paths.

[src]

[src]

Moves projects found through search_terms from the year back to the Working directory.

Returns list of old and new paths.

[src]

Moves a project folder from /working dir to /archive/$year.

[src]

Moves a project folder from /working dir to /archive/$year.

[src]

Matches StorageDir's content against a term and returns matching project files.

This only searches by name TODO return opened Project, no need to reopen

Warning

Please be adviced that this uses Storage::open_projects() and therefore opens all projects.

[src]

Matches StorageDir's content against multiple terms and returns matching projects. TODO add search_multiple_projects_deep

[src]

Tries to find a concrete Project.

[src]

Locates the project file inside a folder.

This is the first file with the super::PROJECT_FILE_EXTENSION in the folder

[src]

Produces a list of project folders.

[src]

Produces a list of empty project folders.

[src]

Produces a list of project files.

[src]

[src]

Behaves like list_project_files() but also opens projects directly.

[src]

Behaves like list_project_files() but also opens projects directly.

[src]

[src]

[src]

Trait Implementations

impl<P: Storable> Debug for Storage<P>
[src]

[src]

Formats the value using the given formatter.