Skip to main content

Crate bombay_address

Crate bombay_address 

Source
Expand description

A typed concurrent address space with generation-safe ownership.

§Address key contracts

Address keys (A: Eq + Hash + Clone) must satisfy these invariants on every call that passes through the space:

  • Deterministic. Hash and Eq must produce the same output for the same input every time they are called.
  • Consistent. Hash and Eq must agree: if a == b, then a.hash(…) and b.hash(…) must write the same bytes to the hasher (the Hash trait requirement).
  • No panic. Hash and Eq must never panic. A panicking Hash or Eq during claim, resolve, or release may leave the address space in an inconsistent state.
  • No re-entrancy. Hash and Eq must not call any method of the same AddressSpace from which they were invoked. The hash-table probe runs under the table’s write or read guard, and parking_lot locks are not re-entrant: a re-entrant Hash or Eq will deadlock. (Endpoint Clone and Drop are intentionally run outside the lock and can safely re-enter the space.)
  • Identity-preserving Clone. A: Clone must preserve Eq and Hash identity: for every address value a, a.clone() == a and a.clone() hashes to the same value as a. The reference documentation calls this the logical Clone contract for key types.

Structs§

AddressInUse
A failed attempt to claim an address that already has a live owner.
AddressSpace
A shared mapping from addresses to typed endpoints.
Lease
Exclusive ownership of one exact address registration generation.
RegistrationId
Opaque identity of one exact registration within the current process.
RegistrationScopeId
Opaque identity of one address-space scope within the current process.
Resolved
A read-only capability for one resolved endpoint snapshot.

Enums§

ClaimError
The reason an address claim failed.