layout.rs

crates/veilvoice-crypto/src/layout.rs

veilvoice-crypto · 331 lines · read the source here · or on GitHub

Everything VeilVoice keeps between runs, in one list.

Why this is here and not in each module

Every state file in this project is derived from crate::lock::default_path and named where it is used: the settings file in the window's prefs, the vaults in its studio, the allowlist in the command line's capture, the mandate in veilvoice-policy. That is the right place for each of them and this list does not replace any of it.

What it adds is the question none of those can answer on its own: what is all of it. Two things ask that. The About tab lists where this copy keeps things, so somebody knows what to back up. The reset offers to remove it, so somebody can start again. Both have to say the same thing about the same files, and a list assembled inside the window cannot be read by the command line, which is where the reset also has to work.

It does not have to be complete for the reset to be

That would be a promise this could not keep: a file added tomorrow in a crate that has never heard of this module would be missed, and a reset that silently leaves something behind is worse than no reset.

So the reset works by exclusion: it removes everything in the folder and keeps what it was told to keep. This list is what puts a name on what is about to go, not what decides that it goes. Something not listed here is still removed; it is simply described as one of the files VeilVoice writes rather than by what it is for.

In plain words

One list of the things VeilVoice keeps on your computer, with a line each about what they are, so the About tab and the reset both say the same thing about the same files.

WHAT THIS FILE CONTAINS

331 lines defining 3 functions (3 public), 2 types and 1 constant. Everything below is read out of the source, so it cannot disagree with the code.

The types it owns.

  • enum Item line 44 · One thing VeilVoice keeps between runs.
  • struct Entry line 72 · One entry: what it is called, what it is, and what losing it costs.

What happens when it runs. These are the ways in: public, and nothing else in this file calls them, so they are what an outside caller reaches first.

  • path line 240 · Where one thing is, if this platform says where anything is.
    reaches dir, entry

WHAT CALLS WHAT

dir line 225 entry line 230 path line 240 entry: a way in: public, and nothing in this file calls it api: public, and also used inside this file dashed: a call that goes back up, or across a wrapped rank The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
    n_dir["dir<br/>line 225"]
    n_entry["entry<br/>line 230"]
    n_path(["path<br/>line 240"])
    n_path --> n_dir
    n_path --> n_entry
    click n_dir href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-crypto/src/layout.rs#L225" "open the source"
    click n_entry href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-crypto/src/layout.rs#L230" "open the source"
    click n_path href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-crypto/src/layout.rs#L240" "open the source"
    classDef entry fill:#1f2335,stroke:#7aa2f7,color:#c0caf5
    class n_path entry
    classDef api fill:#1f2335,stroke:#7dcfff,color:#c0caf5
    class n_dir,n_entry api
    subgraph chart_key ["Key"]
        direction LR
        key_entry["entry: a way in: public, and nothing in this file calls it"]
        key_api["api: public, and also used inside this file"]
    end
    class key_entry entry
    class key_api api

This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.

ITEMS

ItemLineDocumentation
Item pub enum44One thing VeilVoice keeps between runs.
Entry pub struct72One entry: what it is called, what it is, and what losing it costs.
ALL pub const103Every named thing, in the order a person meets it.
dir pub fn225The folder all of this is in, if this platform says where one is.
entry pub fn230The entry for one thing.
path pub fn240Where one thing is, if this platform says where anything is.