use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ForgeError {
Unsupported(String),
Unreachable(String),
Failed(String),
}
impl fmt::Display for ForgeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ForgeError::Unsupported(m) | ForgeError::Unreachable(m) | ForgeError::Failed(m) => f.write_str(m),
}
}
}
pub trait Forge {
fn name(&self) -> &str;
fn repository(&self, url: &str) -> Result<String, ForgeError>;
fn visibility(&self, repository: &str) -> Result<String, ForgeError>;
}