pub struct SyncState {
pub version: String,
pub local_directory: String,
pub drive_folder_id: String,
pub last_full_sync: Option<i64>,
pub files: HashMap<String, FileState>,
}Expand description
Estado geral da sincronização
Fields§
§version: StringVersão do formato de estado (para compatibilidade futura)
local_directory: StringDiretório local sendo sincronizado
drive_folder_id: StringID da pasta raiz no Google Drive
last_full_sync: Option<i64>Timestamp da última sincronização completa
files: HashMap<String, FileState>Mapa de arquivos sincronizados (caminho relativo -> estado)
Implementations§
Source§impl SyncState
impl SyncState
Sourcepub fn new(local_directory: String, drive_folder_id: String) -> Self
pub fn new(local_directory: String, drive_folder_id: String) -> Self
Cria um novo estado de sincronização
Sourcepub fn update_file(&mut self, file_state: FileState)
pub fn update_file(&mut self, file_state: FileState)
Adiciona ou atualiza o estado de um arquivo
Sourcepub fn remove_file(&mut self, relative_path: &str) -> Option<FileState>
pub fn remove_file(&mut self, relative_path: &str) -> Option<FileState>
Remove um arquivo do estado
Sourcepub fn mark_full_sync(&mut self)
pub fn mark_full_sync(&mut self)
Marca a última sincronização completa
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Retorna o número de arquivos sincronizados
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SyncState
impl<'de> Deserialize<'de> for SyncState
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 SyncState
impl RefUnwindSafe for SyncState
impl Send for SyncState
impl Sync for SyncState
impl Unpin for SyncState
impl UnwindSafe for SyncState
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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