pub struct Manifest {
pub version: u32,
pub krypt_version: String,
pub deployed_at: u64,
pub repo_path: PathBuf,
pub repo_commit: Option<String>,
pub entries: BTreeMap<PathBuf, ManifestEntry>,
}Expand description
A complete deploy record.
Fields§
§version: u32Schema version. Currently SCHEMA_VERSION.
krypt_version: StringThe krypt binary version that wrote this manifest.
deployed_at: u64Unix timestamp (seconds since epoch, UTC) of the last write.
repo_path: PathBufAbsolute path to the dotfiles repo root.
repo_commit: Option<String>git rev-parse HEAD of the repo at deploy time, if available.
entries: BTreeMap<PathBuf, ManifestEntry>Per-file deploy records, keyed by dst for fast lookup.
We store this as a list on disk (more readable) but expose it as a map at the API layer so callers can look up by destination.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn new(repo_path: PathBuf) -> Self
pub fn new(repo_path: PathBuf) -> Self
Build an empty manifest stamped with the current time + crate version. Repo path defaults to “” — set it before saving.
Sourcepub fn load(path: &Path) -> Result<Option<Self>, ManifestError>
pub fn load(path: &Path) -> Result<Option<Self>, ManifestError>
Load a manifest from disk. Returns Ok(None) if the file does
not exist — callers treat that as “nothing deployed yet”.
Sourcepub fn save(&self, path: &Path) -> Result<(), ManifestError>
pub fn save(&self, path: &Path) -> Result<(), ManifestError>
Atomically write the manifest to disk. Creates parent dirs.
Sourcepub fn record(&mut self, entry: ManifestEntry)
pub fn record(&mut self, entry: ManifestEntry)
Upsert a record for dst, refreshing hashes + timestamp.
Sourcepub fn forget(&mut self, dst: &Path) -> Option<ManifestEntry>
pub fn forget(&mut self, dst: &Path) -> Option<ManifestEntry>
Forget a destination — used when a [[link]] is removed from
the config and the file is unlinked.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnsafeUnpin for Manifest
impl UnwindSafe for Manifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more