mocra-core 0.4.0

The mocra crawler framework runtime: errors, cache, utilities, domain models, downloader, data-plane queue, coordination, scheduler and engine.
Documentation
use serde::{Deserialize, Serialize};

#[derive(
    Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Default,
)]
pub enum Priority {
    #[serde(rename = "low")]
    Low = 1,
    #[default]
    #[serde(rename = "normal")]
    Normal = 5,
    #[serde(rename = "high")]
    High = 10,
}

impl Priority {
    pub fn suffix(&self) -> &'static str {
        match self {
            Priority::Low => "low",
            Priority::Normal => "normal",
            Priority::High => "high",
        }
    }
}

pub trait Prioritizable {
    fn get_priority(&self) -> Priority;
}