Skip to main content

conduit_cli/core/domain/
source.rs

1use serde::{Deserialize, Serialize};
2use strum::Display;
3use std::path::PathBuf;
4
5#[derive(Debug, Clone, Serialize, Deserialize, Display)]
6#[serde(tag = "type", rename_all = "snake_case")]
7#[strum(serialize_all = "snake_case")]
8pub enum SourceType {
9    Modrinth { id: String, slug: String },
10    Local { path: PathBuf },
11}
12
13#[derive(Debug, Clone, Serialize, Deserialize)]
14pub struct Hash {
15    pub sha1: Option<String>,
16    pub sha256: Option<String>,
17    pub sha512: Option<String>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct AddonSource {
22    pub r#type: SourceType,
23    pub hash: Hash,
24}