pub struct DeployState { /* private fields */ }Implementations§
Source§impl DeployState
impl DeployState
pub fn new(state_dir: &Path) -> Self
pub fn load(state_dir: &Path) -> Result<Self>
Sourcepub fn load_locked(state_dir: &Path) -> Result<Self>
pub fn load_locked(state_dir: &Path) -> Result<Self>
Load state with an exclusive file lock to prevent concurrent access. The lock is held until the DeployState is dropped.
pub fn save(&self) -> Result<()>
pub fn record(&mut self, entry: DeployEntry)
pub fn entries(&self) -> &[DeployEntry]
pub fn entries_mut(&mut self) -> &mut [DeployEntry]
pub fn update_entry_hash(&mut self, index: usize, new_hash: String)
pub fn check_entry_status(&self, entry: &DeployEntry) -> FileStatus
pub fn originals_dir(&self) -> PathBuf
pub fn store_original(&self, content_hash: &str, content: &[u8]) -> Result<()>
pub fn load_original(&self, content_hash: &str) -> Result<Vec<u8>>
pub fn deployed_dir(&self) -> PathBuf
pub fn store_deployed(&self, content_hash: &str, content: &[u8]) -> Result<()>
pub fn load_deployed(&self, content_hash: &str) -> Result<Vec<u8>>
pub fn migrate_storage(state_dir: &Path) -> Result<()>
Sourcepub fn restore(&self, package_filter: Option<&str>) -> Result<usize>
pub fn restore(&self, package_filter: Option<&str>) -> Result<usize>
Restore files to their pre-dotm state. Files with original_hash get their original content written back with original metadata. Files without original_hash (dotm created them) get removed. Returns the count of restored files.
Sourcepub fn undeploy_package(&mut self, package: &str) -> Result<usize>
pub fn undeploy_package(&mut self, package: &str) -> Result<usize>
Remove managed files for a single package and save updated state.
Trait Implementations§
Source§impl Debug for DeployState
impl Debug for DeployState
Source§impl Default for DeployState
impl Default for DeployState
Source§fn default() -> DeployState
fn default() -> DeployState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DeployState
impl<'de> Deserialize<'de> for DeployState
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeployState
impl RefUnwindSafe for DeployState
impl Send for DeployState
impl Sync for DeployState
impl Unpin for DeployState
impl UnsafeUnpin for DeployState
impl UnwindSafe for DeployState
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
Mutably borrows from an owned value. Read more