hyprstream_core/storage/
mod.rs1pub mod adapter_manager;
12pub mod cas;
13pub mod errors;
14pub mod model_ref;
15pub mod paths;
16pub mod pinned_model;
17pub mod release_store;
18
19pub use adapter_manager::{AdapterConfig, AdapterInfo, AdapterManager};
21pub use cas::{BlobManifest, CasError, CasSubstrate, DedupDomain, TrustBoundary};
22pub use errors::{ModelRefError, ModelRefResult};
23pub use model_ref::{validate_model_name, GitRef, ModelRef};
24pub use paths::StoragePaths;
25
26use serde::{Deserialize, Serialize};
31use uuid::Uuid;
32
33#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
35pub struct ModelId(Uuid);
36
37impl ModelId {
38 pub fn new() -> Self {
40 Self(Uuid::new_v4())
41 }
42}
43
44impl Default for ModelId {
45 fn default() -> Self {
46 Self::new()
47 }
48}
49
50impl std::fmt::Display for ModelId {
51 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
52 write!(f, "{}", self.0)
53 }
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
58pub struct ModelMetadata {
59 pub name: String,
61 pub display_name: Option<String>,
63 pub model_type: String,
65 pub created_at: i64,
67 pub updated_at: i64,
69 pub size_bytes: Option<u64>,
71 pub tags: Vec<String>,
73 pub is_dirty: bool,
75}
76
77#[derive(Debug, Clone)]
79pub struct ClonedModel {
80 pub id: ModelId,
82 pub name: String,
84 pub path: std::path::PathBuf,
86}
87
88#[derive(Debug, Default)]
91pub struct CheckoutOptions {
92 pub create_branch: bool,
93 pub force: bool,
94}
95
96#[derive(Debug, Clone)]
98pub struct CheckoutResult {
99 pub previous_oid: git2db::Oid,
100 pub new_oid: git2db::Oid,
101 pub previous_ref_name: Option<String>,
102 pub new_ref_name: Option<String>,
103 pub was_forced: bool,
104 pub files_changed: usize,
105 pub has_submodule: bool,
106}