use super::ObjectAddress;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum DependencyKind {
Normal,
Auto,
Internal,
PartitionPrimary,
PartitionSecondary,
Extension,
AutoExtension,
}
impl DependencyKind {
#[must_use]
pub const fn code(self) -> char {
match self {
Self::Normal => 'n',
Self::Auto => 'a',
Self::Internal => 'i',
Self::PartitionPrimary => 'P',
Self::PartitionSecondary => 'S',
Self::Extension => 'e',
Self::AutoExtension => 'x',
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Dependency {
pub dependent: ObjectAddress,
pub referenced: ObjectAddress,
pub kind: DependencyKind,
}