mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-12 16:03:31 -07:00
28 lines
582 B
Rust
28 lines
582 B
Rust
use clap_derive::ValueEnum;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, ValueEnum)]
|
|
pub enum Website {
|
|
None,
|
|
Bitview,
|
|
Custom,
|
|
}
|
|
|
|
impl Website {
|
|
pub fn is_none(&self) -> bool {
|
|
self == &Self::None
|
|
}
|
|
|
|
pub fn is_some(&self) -> bool {
|
|
!self.is_none()
|
|
}
|
|
|
|
pub fn to_folder_name(self) -> &'static str {
|
|
match self {
|
|
Self::Custom => "custom",
|
|
Self::Bitview => "bitview",
|
|
Self::None => unreachable!(),
|
|
}
|
|
}
|
|
}
|