mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 00:58:11 -05:00
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
23 lines
579 B
Rust
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)
|
|
}
|
|
}
|