Files
reth/crates/net/p2p/src/priority.rs
Thomas Coratger 7c17c6e469 add doc_markdown clippy lint (#8552)
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2024-06-03 13:21:45 +00:00

23 lines
579 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 const fn is_high(&self) -> bool {
matches!(self, Self::High)
}
/// Returns `true` if this is [`Priority::Normal`]
pub const fn is_normal(&self) -> bool {
matches!(self, Self::Normal)
}
}