SessionService
struct · ferroui-protranslate-studio · v0.5.0
struct SessionService
Session, recovery and backup storage share the same explicit host boundary.
Members
newstoragepathsdefault_session_pathsave_snapshotsave_sessionload_sessionsave_recoveryrecovery_sessionclear_recoveryrestore_recoverycreate_backuplist_backupsrestore_backupdelete_backuprotate_backupsbackup_and_rotate
new
fn new(storage: Rc<dyn StudioStorage>, paths: StudioPaths) -> Self
storage
fn storage(self: &Self) -> &Rc<dyn StudioStorage>
paths
fn paths(self: &Self) -> &StudioPaths
default_session_path
fn default_session_path(self: &Self, session: &TranslationSession) -> Result<String, StudioError>
save_snapshot
fn save_snapshot(self: &Self, session: &TranslationSession, path: Option<&str>) -> Result<String, StudioError>
save_session
fn save_session(self: &Self, document: &mut StudioDocument, path: Option<&str>, now_millis: i64) -> Result<SaveOutcome, StudioError>
load_session
fn load_session(self: &Self, path: &str) -> Result<Option<TranslationSession>, StudioError>
save_recovery
fn save_recovery(self: &Self, document: &StudioDocument, now_millis: i64) -> Result<(), StudioError>
recovery_session
fn recovery_session(self: &Self) -> Result<Option<TranslationSession>, StudioError>
clear_recovery
fn clear_recovery(self: &Self) -> Result<(), StudioError>
restore_recovery
fn restore_recovery(self: &Self, document: &mut StudioDocument) -> Result<bool, StudioError>
create_backup
fn create_backup(self: &Self, session: &TranslationSession, now_millis: i64) -> Result<BackupMetadata, StudioError>
list_backups
fn list_backups(self: &Self) -> Result<Vec<BackupMetadata>, StudioError>
restore_backup
fn restore_backup(self: &Self, path: &str) -> Result<Option<TranslationSession>, StudioError>
delete_backup
fn delete_backup(self: &Self, path: &str) -> Result<(), StudioError>
rotate_backups
fn rotate_backups(self: &Self, max_count: usize) -> Result<usize, StudioError>
backup_and_rotate
fn backup_and_rotate(self: &Self, session: &TranslationSession, now_millis: i64, max_count: usize) -> Result<BackupMetadata, StudioError>
Rotation runs only once a complete replacement backup is safely stored.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.