use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub enum AllocationSlot {
MemoryManagerId(u8),
NamedPartition(String),
Custom {
kind: String,
version: u32,
value: Vec<u8>,
},
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub struct AllocationSlotDescriptor {
pub(crate) slot: AllocationSlot,
pub(crate) substrate: String,
pub(crate) descriptor_version: u32,
}
impl AllocationSlotDescriptor {
#[must_use]
pub const fn slot(&self) -> &AllocationSlot {
&self.slot
}
#[must_use]
pub fn substrate(&self) -> &str {
&self.substrate
}
#[must_use]
pub const fn descriptor_version(&self) -> u32 {
self.descriptor_version
}
}