Skip to main content

LockableContainer

Enum LockableContainer 

Source
pub enum LockableContainer {
    RefPointerIndex,
    RefLog,
    ReceivedIndex,
    TrustPolicy,
}
Expand description

One of the four containers RFC 102 Stage 6 Step 2 locks against concurrent writer/compactor races (design-v1.md §15.8, ruled wide by the project owner over the developer’s own narrower lean): the three genuine compaction targets, plus the ref log, whose own tearing exposure predates RFC 102 and is not caused by compaction, but is fixed here because the exclusion machinery being built for compaction closes it for free. trust_key_container is deliberately absent – it never compacts, and stays protected by the unchanged, repository-wide ActiveLock alone, the same as before this stage.

derive(Ord) on a fieldless enum compares by declaration order, which is the one fixed total lock order every multi-container acquisition sorts into (lock::acquire_container_locks, design-v1.md §15.7’s deadlock ruling) – no call site can express an inverted order even by accident, because sorting is structural, not a discipline to remember.

Variants§

§

RefPointerIndex

refs/containers/pointer-index-{a,b}.container – Stage 6 Step 1’s own generation-aware target.

§

RefLog

refs/containers/log-{a,b}.container – never compacted (DC-38/DC-69), but shares the ref pointer index’s write path (publication.rs) and the same unserialized-appender exposure.

§

ReceivedIndex

refs/containers/received-index-{a,b}.container – Stage 6 Step 1’s own generation-aware target, and the container whose investigation (bundle.rs:270’s import_bundle, no lock at all) is what surfaced this whole ruling.

§

TrustPolicy

trust/policy-{a,b}.container – Stage 6 Step 1’s own generation-aware target. Already incidentally protected today by ActiveLock (trust.rs:88,144); gains its own dedicated lock here anyway, per the owner’s decision that the lock is container-scoped, not repository-wide (design-v1.md §15.7 decision 2) – so a prikk compact run on this container never contends with unrelated ActiveLock holders (a commit, a seal) that never touch it.

Implementations§

Source§

impl LockableContainer

Source

pub const ALL: [Self; 4]

Every variant, in the declared total order – the one enumeration prikk unlock (and anything else that needs to sweep every container lock) should use, rather than hand-rolling the list and risking it drift from the enum’s own declaration.

Trait Implementations§

Source§

impl Clone for LockableContainer

Source§

fn clone(&self) -> LockableContainer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LockableContainer

Source§

impl Debug for LockableContainer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LockableContainer

Source§

impl Hash for LockableContainer

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for LockableContainer

Source§

fn cmp(&self, other: &LockableContainer) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for LockableContainer

Source§

fn eq(&self, other: &LockableContainer) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for LockableContainer

Source§

fn partial_cmp(&self, other: &LockableContainer) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for LockableContainer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.