aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-persist/src/state_dir.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* state_dir: When comparing path, use official separatorsIan Jackson2024-01-311-1/+1
| | | | | This would fix the tests on Windows I think ? (Tests which don't seem to run in routine CI AFAICT.)
* state_dir: Use subdirectory rather than + notationIan Jackson2024-01-311-8/+9
| | | | As previously decided and documented.
* state_dir: Break out make_secure_directory closureIan Jackson2024-01-311-4/+11
| | | | | | | We're about to reuse this. This changes the Resource in the error to be more accurate, too. This will be more important as we add another call site.
* state_dir: Introduce local PATH_SEPARATOR aliasIan Jackson2024-01-311-2/+3
| | | | We're going to want this some more.
* tor-persist: state_dir: Remove three unused allowsIan Jackson2024-01-311-3/+0
|
* tor-persist: state_dir: Test functionality that exists nowIan Jackson2024-01-311-0/+106
|
* tor-persist: state_dir: Enable rustfmt (formatting)Ian Jackson2024-01-311-15/+14
| | | | Remaining formatting churn.
* tor-persist: state_dir: Implement StateDirectory::newIan Jackson2024-01-311-1/+17
|
* tor-persist: state_dir: Implement acquire_instanceIan Jackson2024-01-311-7/+142
| | | | | | | And also instance_peek_storage, which needs to share some code, so determined the shape of this implementation. Make StateDirectory have the (one) field we need.
* tor-persist: state_dir: Implement InstanceStateHandle and StorageHandleIan Jackson2024-01-311-8/+89
| | | | | | | | | | These are the straightforward methods which, given a CheckedDir, perform the relevant operation. Make InstanceStateHandle have the necessary fields. Constructing an InstanceStateHandle is a bit complex and will come in a moment.
* tor-persist: state_dir: Have instance id throw fmt::ErrorIan Jackson2024-01-311-5/+5
| | | | | | | | In practice, allowing Bug here was quite inconvenient for everyone. I think very few call sites will want to throw anything interesting. If they *do* want to cause an error, without panicking, they could write a syntactically invalid slug.
* tor-persist: state_dir: Two API fixesIan Jackson2024-01-311-2/+2
| | | | | | | | You don't need to consume a Mistrust to get a CheckedDir - you use a Verifier and then something clones it for you. So StateDirectory::new should take &Mistrust. And instance_peek_storage needs T to be deserialisable!
* tor-persist: state_dir: Rename InstanceStateHandle::purge (from delete)Ian Jackson2024-01-311-2/+2
| | | | | This is rather more serious than many deletions - it wipes out the whole directory. And this name goes better with purge_instances.
* state_dir: Remove a now-unused allowIan Jackson2024-01-251-1/+0
|
* state_dir: Replace InstanceIdString with Slug and SlugRefIan Jackson2024-01-251-44/+14
| | | | And tidy up some of the docs to refer to the slug module.
* state_dir: Abolish now-obsolete Slug trait renameIan Jackson2024-01-251-5/+3
|
* slugs: Provide TryIntoSlug, and replace state_dir::Slug with itIan Jackson2024-01-251-47/+29
|
* Fix doc comments.Nick Mathewson2024-01-241-1/+1
|
* tor-persist: state_dir: Implement the StorageHandle methodsIan Jackson2024-01-241-6/+36
| | | | | You can't call these yet and there aren't any tests. But this demonstrates use of the previous refactoring.
* tor-persist: state_dir: (intend to) use tor_persist::ErrorIan Jackson2024-01-241-16/+4
|
* state-dir: Use a real lock guardIan Jackson2024-01-241-3/+4
| | | | | Bring in the fslock-guard crate and replace the Void in the structs. (Separated out since this contains Cargo.lock churn.)
* state-dir: Move from tor-hsservice to tor-persistIan Jackson2024-01-241-0/+577
And, instead of being a hidden module, it's a public experimental one. I have feature-gated all the new dependencies since we probably want to feature-gate this module in perpetuity, since some builds of Arti won't need it. Closes #1205