pub struct MemoryAllocationPool { /* private fields */ }Expand description
MemoryAllocationPool
One host-wide pool over usable application IDs 10..=254. Governance IDs 0..=9 remain excluded. Explicit additional exclusions retain physical custody for unmanaged users; namespace grants never partition this pool.
The pool is immutable bootstrap policy, not durable allocation state. Every retained ledger record independently retains its ID, including omitted keys. It is not inferred from application bytes or slot contents.
Construct inputs with Self::new; serialization is for diagnostic output.
Decoding is available only with test-support for explicit fixtures.
Implementations§
Source§impl MemoryAllocationPool
impl MemoryAllocationPool
Sourcepub fn new(
authorities: Vec<MemoryAuthority>,
exclusions: Vec<u8>,
) -> Result<Self, MemoryAllocationPoolError>
pub fn new( authorities: Vec<MemoryAuthority>, exclusions: Vec<u8>, ) -> Result<Self, MemoryAllocationPoolError>
Canonicalize host grants and physical exclusions before bootstrap.
Current owner grants, in canonical namespace order.
Sourcepub fn excluded_ids(&self) -> impl Iterator<Item = u8> + '_
pub fn excluded_ids(&self) -> impl Iterator<Item = u8> + '_
Excluded usable IDs, including governance, in ascending order.
Validate current key ownership independently of numeric placement.
Borrow the current namespace grant for a checked key. This does not establish commitment, historical ownership or caller authentication.
Sourcepub fn validate_id(&self, id: u8) -> Result<(), MemoryAllocationPoolError>
pub fn validate_id(&self, id: u8) -> Result<(), MemoryAllocationPoolError>
Validate physical eligibility without granting ownership of a key.