pub trait ConfigOperations {
// Required methods
fn with_config<P: AsRef<Path>>(self, config_path: P) -> Self;
fn calculate_checksum<P: AsRef<Path>>(
&self,
path: P,
algorithm: ChecksumAlgorithm,
) -> Result<ChecksumResult>;
fn calculate_checksums<P: AsRef<Path>>(
&self,
path: P,
algorithms: &[ChecksumAlgorithm],
) -> Result<Vec<ChecksumResult>>;
fn verify_checksum<P: AsRef<Path>>(
&self,
path: P,
expected: &str,
algorithm: ChecksumAlgorithm,
) -> Result<bool>;
fn diff<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
source: P,
target: Q,
) -> Result<DiffResult>;
fn diff_tags<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
source: P,
target: Q,
tags: &[TagId],
) -> Result<DiffResult>;
}Expand description
配置操作 trait
Required Methods§
Sourcefn with_config<P: AsRef<Path>>(self, config_path: P) -> Self
fn with_config<P: AsRef<Path>>(self, config_path: P) -> Self
加载配置文件
Sourcefn calculate_checksum<P: AsRef<Path>>(
&self,
path: P,
algorithm: ChecksumAlgorithm,
) -> Result<ChecksumResult>
fn calculate_checksum<P: AsRef<Path>>( &self, path: P, algorithm: ChecksumAlgorithm, ) -> Result<ChecksumResult>
计算校验和
Sourcefn calculate_checksums<P: AsRef<Path>>(
&self,
path: P,
algorithms: &[ChecksumAlgorithm],
) -> Result<Vec<ChecksumResult>>
fn calculate_checksums<P: AsRef<Path>>( &self, path: P, algorithms: &[ChecksumAlgorithm], ) -> Result<Vec<ChecksumResult>>
计算多个校验和
Sourcefn verify_checksum<P: AsRef<Path>>(
&self,
path: P,
expected: &str,
algorithm: ChecksumAlgorithm,
) -> Result<bool>
fn verify_checksum<P: AsRef<Path>>( &self, path: P, expected: &str, algorithm: ChecksumAlgorithm, ) -> Result<bool>
验证文件完整性
Sourcefn diff<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
source: P,
target: Q,
) -> Result<DiffResult>
fn diff<P: AsRef<Path>, Q: AsRef<Path>>( &self, source: P, target: Q, ) -> Result<DiffResult>
比较两个文件的元数据
比较两个文件的元数据(仅特定标签)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.