Skip to main content

AllocationPolicy

Trait AllocationPolicy 

Source
pub trait AllocationPolicy {
    type Error;

    // Required methods
    fn validate_key(&self, key: &StableKey) -> Result<(), Self::Error>;
    fn validate_slot(
        &self,
        key: &StableKey,
        slot: &AllocationSlotDescriptor,
    ) -> Result<(), Self::Error>;
    fn validate_reserved_slot(
        &self,
        key: &StableKey,
        slot: &AllocationSlotDescriptor,
    ) -> Result<(), Self::Error>;
}
Expand description

AllocationPolicy

Framework-supplied rules for whether a key may claim a slot.

Required Associated Types§

Source

type Error

Policy error type.

Required Methods§

Source

fn validate_key(&self, key: &StableKey) -> Result<(), Self::Error>

Validate a stable key against framework naming rules.

Source

fn validate_slot( &self, key: &StableKey, slot: &AllocationSlotDescriptor, ) -> Result<(), Self::Error>

Validate a stable-key to allocation-slot claim.

Source

fn validate_reserved_slot( &self, key: &StableKey, slot: &AllocationSlotDescriptor, ) -> Result<(), Self::Error>

Validate a reserved stable-key to allocation-slot claim.

Implementors§