pub enum LeafPermit {
OpenFile(OpenFileGuard),
PendingMeta(PendingMetaGuard),
}Expand description
A pre-acquired leaf permit, type-erased over the two distinct backpressure pools so a single caller (the traversal driver) can hold either uniformly and drop it in exactly one place before recursing into a directory.
The two pools must stay distinct: throttle::OpenFileGuard gates open
file descriptors while throttle::PendingMetaGuard gates in-flight
metadata-only tasks. They are sized independently so a path that composes
the two operations (e.g. copy_file → rm when overwriting a directory
destination) cannot self-deadlock against a saturated open-files pool.
This enum unifies only the lifecycle, never the pools themselves.
Neither guard is Clone; dropping a LeafPermit releases exactly the
underlying permit it wraps. The driver drops it before descending so a
directory entry never holds a leaf permit across its recursive walk —
the single home for the invariant that previously lived at 4/7/1/1
per-tool branch sites and shipped as a deadlock when a single-site tool
forgot it.
Variants§
OpenFile(OpenFileGuard)
A permit from the open-files pool.
PendingMeta(PendingMetaGuard)
A permit from the pending-metadata pool.
Auto Trait Implementations§
impl !RefUnwindSafe for LeafPermit
impl !UnwindSafe for LeafPermit
impl Freeze for LeafPermit
impl Send for LeafPermit
impl Sync for LeafPermit
impl Unpin for LeafPermit
impl UnsafeUnpin for LeafPermit
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> 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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request