pub struct ArenaAdmit {
pub scope: u64,
pub policy_generation: u64,
pub source_generation: u64,
pub lease: BufferLease,
/* private fields */
}Expand description
Lease/scope wrapper over caller-owned arena backing.
Does not own or allocate the 42 MiB buffer. live_rules / reserved_rules
are staging counters for this admit record only.
Fields§
§scope: u64§policy_generation: u64§source_generation: u64§lease: BufferLeaseImplementations§
Source§impl ArenaAdmit
impl ArenaAdmit
Sourcepub fn reset_for_reuse(&mut self) -> Result<(), QdnfError>
pub fn reset_for_reuse(&mut self) -> Result<(), QdnfError>
Zero live_rules (and unused reservations). Keep lease/scope/policy/source.
Prevents stale staging from leaking between jobs in this admit record.
Does not touch SlgArena; the caller zeros their own buffer.
Sourcepub fn reset_bound_slots(
&mut self,
slots: &mut [NQuin],
recent: &mut [usize],
head: &mut usize,
) -> Result<(), QdnfError>
pub fn reset_bound_slots( &mut self, slots: &mut [NQuin], recent: &mut [usize], head: &mut usize, ) -> Result<(), QdnfError>
Reset caller-owned scratch slots that stand in for Sentinel backing. Tests must not allocate 42 MiB to prove this binding.
Sourcepub fn reset_slg_arena(&mut self, arena: &mut SlgArena) -> Result<(), QdnfError>
pub fn reset_slg_arena(&mut self, arena: &mut SlgArena) -> Result<(), QdnfError>
Bind reuse to a live super::SlgArena pass. Does not construct one.
Sourcepub fn require_scope(
&self,
scope: u64,
policy_generation: u64,
source_generation: u64,
) -> Result<(), QdnfError>
pub fn require_scope( &self, scope: u64, policy_generation: u64, source_generation: u64, ) -> Result<(), QdnfError>
Bind this admit record to scope + policy/source generations.
Cross-scope → QdnfError::Unauthorized. Generation mismatch →
QdnfError::StaleGeneration.
Sourcepub fn reserve_rule_slot(&mut self) -> Result<(), QdnfError>
pub fn reserve_rule_slot(&mut self) -> Result<(), QdnfError>
Reserve a staging slot. Must succeed before incrementing live_rules.
Capacity at MAX_RULE_STAGING (live + reserved).
Sourcepub fn activate_reserved_rule(&mut self) -> Result<(), QdnfError>
pub fn activate_reserved_rule(&mut self) -> Result<(), QdnfError>
Move one reservation into live_rules. Conflict if none reserved.
Sourcepub fn revoke(self, leases: &mut LeaseTable) -> Result<(), QdnfError>
pub fn revoke(self, leases: &mut LeaseTable) -> Result<(), QdnfError>
Release the exclusive lease. Subsequent LeaseTable::release of a stored
handle copy is QdnfError::DoubleRelease or QdnfError::StaleGeneration.
Sourcepub const fn live_rules(&self) -> u16
pub const fn live_rules(&self) -> u16
Live (activated) rule count for this admit record.
Sourcepub const fn reserved_rules(&self) -> u16
pub const fn reserved_rules(&self) -> u16
Reserved but not yet activated rule count for this admit record.
Trait Implementations§
Source§impl Clone for ArenaAdmit
impl Clone for ArenaAdmit
impl Copy for ArenaAdmit
Source§impl Debug for ArenaAdmit
impl Debug for ArenaAdmit
impl Eq for ArenaAdmit
Source§impl PartialEq for ArenaAdmit
impl PartialEq for ArenaAdmit
impl StructuralPartialEq for ArenaAdmit
Auto Trait Implementations§
impl Freeze for ArenaAdmit
impl RefUnwindSafe for ArenaAdmit
impl Send for ArenaAdmit
impl Sync for ArenaAdmit
impl Unpin for ArenaAdmit
impl UnsafeUnpin for ArenaAdmit
impl UnwindSafe for ArenaAdmit
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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