pub struct ClaimSet { /* private fields */ }Expand description
Exclusive in-process ownership of one spool entry’s relay.
Why: both ingest and the sweep can reach the same entry path. A claim held
for the duration of the relay makes “someone is already relaying this” a
checkable fact rather than a timing hope.
What: a shared HashSet<PathBuf>. Locks are held only across the insert or
remove, never across an await.
In-process only, and deliberately so: two console processes sharing one
spool directory would still double-relay. That is out of scope here because
console is a singleton per data directory, and the target-side
delivery_id dedup step 4 owes is the real cross-process answer.
Test: claim_set_refuses_a_second_claim_on_the_same_path,
claim_set_releases_on_drop_even_when_the_holder_panics.
Implementations§
Source§impl ClaimSet
impl ClaimSet
Sourcepub fn claim(&self, path: &Path) -> Option<Claim>
pub fn claim(&self, path: &Path) -> Option<Claim>
Take exclusive ownership of path, or None if someone already has it.
The returned guard releases on drop, including on panic and on an early
? return, so a failed relay cannot leave an entry permanently claimed.
Test: claim_set_refuses_a_second_claim_on_the_same_path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClaimSet
impl RefUnwindSafe for ClaimSet
impl Send for ClaimSet
impl Sync for ClaimSet
impl Unpin for ClaimSet
impl UnsafeUnpin for ClaimSet
impl UnwindSafe for ClaimSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more