l1fe-weave-core · filesystem::diff
Source declarations, signatures and documentation for filesystem::diff.
Reviewed implementation boundary: Some core wrappers derive transport keys from DID strings. Do not infer secret key custody or authenticated peers from a supplied DID string; inspect the chosen wrapper and transport configuration. See /libraries/weave-core/overview.
Source: sigil/weave/libs/weave-core/src/filesystem/diff.rs. SHA-256: 20fa88453daf94c40a2d5863ccbc6cd7081b676327dacc1516b954fa9eb5d281.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
filesystem::diff::DiffKind
Kind of diff entry
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiffKind {
/// File was added
Added,
/// File was modified
Modified,
/// File was deleted
Deleted,
/// File was renamed
/// Original path for a rename operation
#[allow(missing_docs)]
Renamed { from: PathBuf },
}Source line: 10.
filesystem::diff::DiffEntry
Diff entry
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DiffEntry {
/// Path
pub path: PathBuf,
/// Kind of change
pub kind: DiffKind,
/// Old checksum (for modified/deleted)
pub old_checksum: Option<[u8; 32]>,
/// New checksum (for added/modified)
pub new_checksum: Option<[u8; 32]>,
/// Size difference
pub size_diff: i64
}Source line: 25.
filesystem::diff::Diff
Diff between two states
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Diff {
/// Diff ID
pub id: String,
/// Source state
pub source: String,
/// Target state
pub target: String,
/// Timestamp
pub timestamp: chrono::DateTime<chrono::Utc>,
/// Entries
pub entries: Vec<DiffEntry>
}Source line: 40.
filesystem::diff::Diff::new
Create a new diff
pub fn new(source: String, target: String) -> Self;Source line: 55.
filesystem::diff::Diff::compute
Compute diff between two file lists
pub fn compute(
source_files: HashMap<PathBuf, FileInfo>,
target_files: HashMap<PathBuf, FileInfo>,
) -> Result<Self>;Source line: 66.
filesystem::diff::Diff::apply
Apply diff to transform source to target
pub async fn apply<F, G, H>(
&self,
mut read_fn: F,
mut write_fn: G,
mut delete_fn: H,
) -> Result<()>
where
F: FnMut(&Path) -> Result<Vec<u8>>,
G: FnMut(&Path, Vec<u8>) -> Result<()>,
H: FnMut(&Path) -> Result<()>,;Source line: 117.
filesystem::diff::Diff::size_change
Get total size change
pub fn size_change(&self) -> i64;Source line: 151.
filesystem::diff::Diff::summary
Get change summary
pub fn summary(&self) -> DiffSummary;Source line: 156.
filesystem::diff::FileInfo
File info for diff computation
#[derive(Debug, Clone)]
pub struct FileInfo {
/// File size
pub size: u64,
/// File checksum
pub checksum: [u8; 32],
/// Modification time
pub modified: chrono::DateTime<chrono::Utc>
}Source line: 183.
filesystem::diff::DiffSummary
Diff summary
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DiffSummary {
/// Files added
pub added: usize,
/// Files modified
pub modified: usize,
/// Files deleted
pub deleted: usize,
/// Files renamed
pub renamed: usize,
/// Total changes
pub total: usize
}Source line: 194.