pub struct MemoryManagerRangeAuthority { /* private fields */ }Expand description
MemoryManagerRangeAuthority
Substrate-specific range authority policy helper for MemoryManager IDs.
This helper records policy and diagnostic authority ranges only. It never mutates the allocation ledger, and it does not allocate or reserve durable stable-memory slots. Durable allocation remains the generic ledger mapping from stable key to allocation slot.
When used through the default runtime registry, registered ranges are
authoritative generic policy and are checked before caller-supplied
crate::AllocationPolicy. When no user ranges are registered, frameworks
can enforce fixed application claims through their own policy. Logical
placement and historical selection always require explicit grants; fresh
placements use only Allowed ranges.
Implementations§
Source§impl MemoryManagerRangeAuthority
impl MemoryManagerRangeAuthority
Sourcepub fn from_records(
records: Vec<MemoryManagerAuthorityRecord>,
) -> Result<Self, MemoryManagerRangeAuthorityError>
pub fn from_records( records: Vec<MemoryManagerAuthorityRecord>, ) -> Result<Self, MemoryManagerRangeAuthorityError>
Build a range authority from diagnostic records.
Records already carry checked bounds and metadata. Reject overlaps in input order and retain accepted records in ascending range order in the supplied buffer.
Validate that slot belongs to expected_authority.
Validate that slot belongs to expected_authority with expected_mode.
Validate that id belongs to expected_authority.
Validate that id belongs to expected_authority with expected_mode.
Return the authority record that governs id, if any.
Ordered non-overlapping authority records.
This is the stable diagnostic/export surface for the authority table. Records are returned in ascending range order and do not imply ledger allocation state.
Sourcepub fn validate_complete_coverage(
&self,
target: MemoryManagerIdRange,
) -> Result<(), MemoryManagerRangeAuthorityError>
pub fn validate_complete_coverage( &self, target: MemoryManagerIdRange, ) -> Result<(), MemoryManagerRangeAuthorityError>
Validate that authority records exactly and contiguously cover target.
All records must be inside target, and together they must form a
gap-free partition. This checks policy table coverage only and never
changes allocation ledger state.