FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SessionService

    struct · ferroui-protranslate-studio · v0.5.0

    struct SessionService
    

    Session, recovery and backup storage share the same explicit host boundary.

    View source

    Members

    new

    fn new(storage: Rc<dyn StudioStorage>, paths: StudioPaths) -> Self
    

    Source

    storage

    fn storage(self: &Self) -> &Rc<dyn StudioStorage>
    

    Source

    paths

    fn paths(self: &Self) -> &StudioPaths
    

    Source

    default_session_path

    fn default_session_path(self: &Self, session: &TranslationSession) -> Result<String, StudioError>
    

    Source

    save_snapshot

    fn save_snapshot(self: &Self, session: &TranslationSession, path: Option<&str>) -> Result<String, StudioError>
    

    Source

    save_session

    fn save_session(self: &Self, document: &mut StudioDocument, path: Option<&str>, now_millis: i64) -> Result<SaveOutcome, StudioError>
    

    Source

    load_session

    fn load_session(self: &Self, path: &str) -> Result<Option<TranslationSession>, StudioError>
    

    Source

    save_recovery

    fn save_recovery(self: &Self, document: &StudioDocument, now_millis: i64) -> Result<(), StudioError>
    

    Source

    recovery_session

    fn recovery_session(self: &Self) -> Result<Option<TranslationSession>, StudioError>
    

    Source

    clear_recovery

    fn clear_recovery(self: &Self) -> Result<(), StudioError>
    

    Source

    restore_recovery

    fn restore_recovery(self: &Self, document: &mut StudioDocument) -> Result<bool, StudioError>
    

    Source

    create_backup

    fn create_backup(self: &Self, session: &TranslationSession, now_millis: i64) -> Result<BackupMetadata, StudioError>
    

    Source

    list_backups

    fn list_backups(self: &Self) -> Result<Vec<BackupMetadata>, StudioError>
    

    Source

    restore_backup

    fn restore_backup(self: &Self, path: &str) -> Result<Option<TranslationSession>, StudioError>
    

    Source

    delete_backup

    fn delete_backup(self: &Self, path: &str) -> Result<(), StudioError>
    

    Source

    rotate_backups

    fn rotate_backups(self: &Self, max_count: usize) -> Result<usize, StudioError>
    

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.