Files
reth/crates/interfaces/src/p2p/priority.rs
2023-05-13 13:18:24 -04:00

23 lines
565 B
Rust

/// BlockHeader and BodyHeader DownloadRequest priority
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Priority {
/// Queued from the back for download requests.
#[default]
Normal,
/// Queued from the front for download requests.
High,
}
impl Priority {
/// Returns `true` if this is [Priority::High]
pub fn is_high(&self) -> bool {
matches!(self, Priority::High)
}
/// Returns `true` if this is [Priority::Normal]
pub fn is_normal(&self) -> bool {
matches!(self, Priority::Normal)
}
}