aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2024-01-10 12:54:34 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2024-01-12 00:09:31 +0000
commit6341e0b1cf8a41ba0febf6e78698d262ac199613 (patch)
tree4a958e345a4cf3bba9dd1f07f67de96d47130cda
parentbc16b0f77026cb3f7f6dfabc17bb04946e9f4941 (diff)
downloadarti-6341e0b1cf8a41ba0febf6e78698d262ac199613.tar.gz
arti-6341e0b1cf8a41ba0febf6e78698d262ac199613.zip
state_dir sketch: Rename Liveness::PossiblyUnused from Unused
It is OK to return this even for used things, or if you don't know - the API user (trait implementor) gets a second bite at the cherry in `dispose`.
-rw-r--r--crates/tor-hsservice/src/state_dir.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/tor-hsservice/src/state_dir.rs b/crates/tor-hsservice/src/state_dir.rs
index 86bf5146a..8311f7632 100644
--- a/crates/tor-hsservice/src/state_dir.rs
+++ b/crates/tor-hsservice/src/state_dir.rs
@@ -179,7 +179,7 @@ pub trait ExpirableInstance: InstanceIdentity {
/// either call [`delete`](InstanceStateHandle::delete),
/// or simply drop `handle`.
///
- /// Called only after `name_filter` returned [`Liveness::Unused`]
+ /// Called only after `name_filter` returned [`Liveness::PossiblyUnused`]
/// and only if the instance has not been acquired or modified recently.
fn dispose(identity: &InstanceIdString, handle: InstanceStateHandle) -> Result<()>;
}
@@ -231,8 +231,10 @@ pub trait Slug: ToString {}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[allow(clippy::exhaustive_enums)] // this is a boolean
pub enum Liveness {
- /// This instance is not interesting and could be expired, if it's been long enough
- Unused,
+ /// This instance is not known to be interesting
+ ///
+ /// It could be perhaps expired, if it's been long enough
+ PossiblyUnused,
/// This instance is still wanted
Live,
}