use std::fmt::{self, Display, Formatter};
#[derive(Copy, Clone, Debug, Eq, Ord, PartialOrd, PartialEq, Hash)]
pub enum RecordsSection {
Answer = 0,
Authority = 1,
Additional = 2,
}
impl RecordsSection {
pub const VALUES: [RecordsSection; 3] = [
RecordsSection::Answer,
RecordsSection::Authority,
RecordsSection::Additional,
];
pub fn to_str(self) -> &'static str {
match self {
RecordsSection::Answer => "Answer",
RecordsSection::Authority => "Authority",
RecordsSection::Additional => "Additional",
}
}
}
impl Display for RecordsSection {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.pad(self.to_str())
}
}