pub struct ProjectMeta {
pub version: u32,
pub uuid: Uuid,
pub name: String,
pub local_path: String,
pub remote_path: String,
pub size_bytes: u64,
pub file_count: u32,
pub last_sync: DateTime<Utc>,
pub compression: bool,
pub encryption_enabled: bool,
pub public_key: Option<String>,
pub state: ProjectState,
}Expand description
Core metadata for a tracked project.
Serialized as .project.toml inside the project directory.
This file persists locally regardless of whether the project
content is present (Local state) or stored on the server
(Archived state), providing stable identity and reconnection
information.
Fields§
§version: u32Schema version for forward compatibility.
uuid: UuidUnique identifier for this project, generated at creation time. Survives renames and moves.
name: StringHuman-readable project name, derived from the directory name at the time of first archive.
local_path: StringAbsolute path to the project directory on the local machine.
remote_path: StringServer-side storage reference in the format “host:port:/base/path/project-name”.
size_bytes: u64Total size in bytes at the time of the last successful sync.
file_count: u32Number of files in the project at the time of the last sync.
last_sync: DateTime<Utc>Timestamp of the last successful sync (upload or download).
compression: boolWhether compression was used during the last transfer.
encryption_enabled: boolWhether at-rest encryption was enabled for this project.
public_key: Option<String>The age public key used for encrypting this project’s archive, stored as a Bech32-encoded string. Only set if encryption is enabled.
state: ProjectStateCurrent state of the project.
Implementations§
Source§impl ProjectMeta
impl ProjectMeta
Sourcepub fn new_local(name: String, local_path: String, remote_path: String) -> Self
pub fn new_local(name: String, local_path: String, remote_path: String) -> Self
Create metadata for a new project that is currently local.
Generates a fresh UUIDv4 and sets the last_sync timestamp to the current time. The project starts in the Local state with zero size and no compression or encryption.
Sourcepub fn new_local_encrypted(
name: String,
local_path: String,
remote_path: String,
public_key: String,
) -> Self
pub fn new_local_encrypted( name: String, local_path: String, remote_path: String, public_key: String, ) -> Self
Create metadata with encryption enabled.
Generates a fresh UUIDv4 and stores the age public key that will be used to encrypt the project archive before uploading to the server.
Sourcepub fn mark_archived(
&mut self,
size_bytes: u64,
file_count: u32,
compression: bool,
)
pub fn mark_archived( &mut self, size_bytes: u64, file_count: u32, compression: bool, )
Mark the project as archived after a successful upload to the server.
Updates the state, records the transferred size and file count, and sets the last_sync timestamp to now.
Sourcepub fn mark_local(&mut self, size_bytes: u64, file_count: u32)
pub fn mark_local(&mut self, size_bytes: u64, file_count: u32)
Mark the project as local after a successful download from the server.
Updates the state, records the restored size, and sets the last_sync timestamp to now.
Sourcepub fn is_archived(&self) -> bool
pub fn is_archived(&self) -> bool
Returns true if the project is currently archived (stored on
the server, local directory is a placeholder).
Sourcepub fn days_since_sync(&self) -> f64
pub fn days_since_sync(&self) -> f64
Return the number of days since the last sync.
Useful for identifying stale projects that might be candidates for automatic archival.
Sourcepub fn size_human(&self) -> String
pub fn size_human(&self) -> String
Format the project size in a human-readable way (e.g., “1.5 GB”).
Trait Implementations§
Source§impl Clone for ProjectMeta
impl Clone for ProjectMeta
Source§fn clone(&self) -> ProjectMeta
fn clone(&self) -> ProjectMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more