pub struct FileEntry {Show 15 fields
pub id: String,
pub original_path: PathBuf,
pub stored_path: PathBuf,
pub file_size: u64,
pub compressed_size: u64,
pub created_at: String,
pub compression_algorithm: CompressionAlgorithm,
pub hash: Option<String>,
pub is_reference: Option<bool>,
pub original_storage_id: Option<String>,
pub ref_count: Option<u32>,
pub is_delta: Option<bool>,
pub base_storage_id: Option<String>,
pub similarity_score: Option<f32>,
pub delta_algorithm: Option<DeltaAlgorithm>,
}Fields§
§id: String§original_path: PathBuf§stored_path: PathBuf§file_size: u64§compressed_size: u64§created_at: String§compression_algorithm: CompressionAlgorithm§hash: Option<String>§is_reference: Option<bool>§original_storage_id: Option<String>§ref_count: Option<u32>§is_delta: Option<bool>§base_storage_id: Option<String>§similarity_score: Option<f32>§delta_algorithm: Option<DeltaAlgorithm>Implementations§
Source§impl FileEntry
impl FileEntry
Sourcepub fn new(
id: String,
original_path: PathBuf,
stored_path: PathBuf,
file_size: u64,
compressed_size: u64,
compression_algorithm: CompressionAlgorithm,
) -> Self
pub fn new( id: String, original_path: PathBuf, stored_path: PathBuf, file_size: u64, compressed_size: u64, compression_algorithm: CompressionAlgorithm, ) -> Self
创建新的文件条目
Sourcepub fn set_dedup_info(&mut self, dedup_info: DedupInfo)
pub fn set_dedup_info(&mut self, dedup_info: DedupInfo)
设置去重信息
Sourcepub fn set_delta_info(&mut self, delta_info: DeltaInfo)
pub fn set_delta_info(&mut self, delta_info: DeltaInfo)
设置差分信息
Sourcepub fn is_reference_file(&self) -> bool
pub fn is_reference_file(&self) -> bool
检查是否为引用文件
Sourcepub fn is_delta_file(&self) -> bool
pub fn is_delta_file(&self) -> bool
检查是否为差分文件
Sourcepub fn get_actual_storage_size(&self) -> u64
pub fn get_actual_storage_size(&self) -> u64
获取实际存储大小(考虑引用文件)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileEntry
impl<'de> Deserialize<'de> for FileEntry
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 FileEntry
impl RefUnwindSafe for FileEntry
impl Send for FileEntry
impl Sync for FileEntry
impl Unpin for FileEntry
impl UnwindSafe for FileEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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