pub struct FileSyncResult {Show 25 fields
pub path: String,
pub status: FileSyncStatus,
pub size: u64,
pub transferred_size: u64,
pub source_hash: Option<String>,
pub target_hash: Option<String>,
pub operation: FileOperation,
pub start_time: Option<DateTime<Utc>>,
pub end_time: Option<DateTime<Utc>>,
pub duration_ms: Option<u64>,
pub transfer_speed: Option<f64>,
pub retry_count: u32,
pub encrypted: bool,
pub chunked: bool,
pub chunk_count: Option<usize>,
pub checksum_verified: Option<bool>,
pub error: Option<String>,
pub warnings: Vec<String>,
pub metadata: Value,
pub operation_id: String,
pub source_path: Option<String>,
pub target_path: String,
pub file_type: FileType,
pub permissions: Option<u32>,
pub modified_time: Option<DateTime<Utc>>,
}Expand description
文件同步结果
Fields§
§path: String文件路径
status: FileSyncStatus文件状态
size: u64文件大小(字节)
transferred_size: u64传输大小(实际传输的字节数,可能包括加密开销)
source_hash: Option<String>源文件哈希
target_hash: Option<String>目标文件哈希
operation: FileOperation文件同步操作
start_time: Option<DateTime<Utc>>开始时间
end_time: Option<DateTime<Utc>>结束时间
duration_ms: Option<u64>传输耗时(毫秒)
transfer_speed: Option<f64>传输速度(字节/秒)
retry_count: u32重试次数
encrypted: bool是否加密传输
chunked: bool是否分块传输
chunk_count: Option<usize>分块数量
checksum_verified: Option<bool>校验和验证结果
error: Option<String>错误信息(如果有)
warnings: Vec<String>警告信息
metadata: Value自定义元数据
operation_id: String操作ID(用于去重和跟踪)
source_path: Option<String>源文件路径(可能不同)
target_path: String目标文件路径
file_type: FileType文件类型
permissions: Option<u32>文件权限
modified_time: Option<DateTime<Utc>>文件修改时间
Implementations§
Source§impl FileSyncResult
impl FileSyncResult
pub fn new(path: String, operation: FileOperation) -> Self
pub fn from_diff(diff: &FileDiff, operation: FileOperation) -> Self
pub fn mark_started(&mut self)
pub fn mark_completed(&mut self, success: bool)
pub fn mark_retry(&mut self, error: Option<String>)
pub fn mark_verifying(&mut self)
pub fn mark_verified(&mut self, verified: bool)
pub fn add_warning(&mut self, warning: String)
pub fn is_success(&self) -> bool
pub fn is_failed(&self) -> bool
pub fn is_completed(&self) -> bool
pub fn duration(&self) -> Option<Duration>
pub fn human_readable_size(&self) -> String
pub fn human_readable_transferred(&self) -> String
pub fn human_readable_speed(&self) -> Option<String>
pub fn summary(&self) -> String
pub fn detailed_info(&self) -> String
pub fn to_json(&self) -> Result<String, Error>
pub fn from_json(json: &str) -> Result<Self, Error>
Trait Implementations§
Source§impl Debug for FileSyncResult
impl Debug for FileSyncResult
Source§impl<'de> Deserialize<'de> for FileSyncResult
impl<'de> Deserialize<'de> for FileSyncResult
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 FileSyncResult
impl RefUnwindSafe for FileSyncResult
impl Send for FileSyncResult
impl Sync for FileSyncResult
impl Unpin for FileSyncResult
impl UnwindSafe for FileSyncResult
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