facto_core/runtimes/
trait_def.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum RuntimeError {
5 #[error("http error: {0}")]
6 Http(#[from] reqwest::Error),
7 #[error("parse error: {0}")]
8 Parse(String),
9 #[error("unknown runtime: {0}")]
10 Unknown(String),
11}
12
13pub type RuntimeResult<T> = Result<T, RuntimeError>;
14
15pub trait Runtime: Send + Sync {
16 fn id(&self) -> &str;
17 fn display_name(&self) -> &str;
18 fn endoflife_id(&self) -> &str;
19 fn changelog_url(&self, cycle: &str) -> Option<String>;
20}