FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    StudioDocument

    struct · ferroui-protranslate-studio · v0.5.0

    struct StudioDocument
    

    An owned document; hosts decide how to expose notifications and selection.

    View source

    Members

    new

    fn new(session_id: impl Into<String>, imported: ImportedCatalog, now_millis: i64) -> Result<Self, StudioError>
    

    Source

    from_session

    fn from_session(session: TranslationSession) -> Result<Self, StudioError>
    

    Source

    restore

    fn restore(self: &mut Self, session: TranslationSession, recovered: bool) -> Result<(), StudioError>
    

    Source

    session

    fn session(self: &Self) -> &TranslationSession
    

    Source

    snapshot

    fn snapshot(self: &Self, now_millis: i64) -> TranslationSession
    

    Source

    catalog

    fn catalog(self: &Self) -> &TranslationCatalog
    

    Source

    is_dirty

    fn is_dirty(self: &Self) -> bool
    

    Source

    mark_saved

    fn mark_saved(self: &mut Self, snapshot: &TranslationSession) -> bool
    

    Call only after the host successfully persisted this exact snapshot.

    Source

    generation

    fn generation(self: &Self) -> u64
    

    Source

    undo_count

    fn undo_count(self: &Self) -> usize
    

    Source

    redo_count

    fn redo_count(self: &Self) -> usize
    

    Source

    set_history_limit

    fn set_history_limit(self: &mut Self, limit: usize)
    

    Source

    entry

    fn entry(self: &Self, id: EntryId) -> Option<(&TranslationCatalogEntry, &EntryStatus)>
    

    Source

    filtered_ids

    fn filtered_ids(self: &Self, filter: &EntryFilter) -> Vec<EntryId>
    

    Source

    metrics

    fn metrics(self: &Self, culture: Option<&str>) -> ReviewMetrics
    

    Source

    coverage

    fn coverage(self: &Self) -> Vec<TranslationCoverage>
    

    Distinct keys use the converter's last-entry-wins rule. Missing keys count.

    Source

    set_target

    fn set_target(self: &mut Self, id: EntryId, value: impl Into<String>) -> Result<bool, StudioError>
    

    Source

    set_notes

    fn set_notes(self: &mut Self, id: EntryId, notes: Option<String>) -> Result<bool, StudioError>
    

    Source

    set_review

    fn set_review(self: &mut Self, id: EntryId, review: TranslationReviewState) -> Result<bool, StudioError>
    

    Source

    replace_entry

    fn replace_entry(self: &mut Self, id: EntryId, value: TranslationCatalogEntry, review: TranslationReviewState) -> Result<bool, StudioError>
    

    Source

    add_entry

    fn add_entry(self: &mut Self, entry: TranslationCatalogEntry) -> Result<EntryId, StudioError>
    

    Source

    delete_entry

    fn delete_entry(self: &mut Self, id: EntryId) -> Result<(), StudioError>
    

    Source

    add_target_culture

    fn add_target_culture(self: &mut Self, culture_name: &str, display_name: impl Into<String>) -> Result<bool, StudioError>
    

    Source

    set_target_culture

    fn set_target_culture(self: &mut Self, culture: &str) -> Result<bool, StudioError>
    

    Source

    export

    fn export(self: &Self, format: TranslationFileFormat, options: &TranslationFormatOptions) -> Result<TranslationExportResult, StudioError>
    

    Export the normalized catalog with its original native format states. For Studio review states, explicitly export catalog_with_review_states() through CatalogGateway; its generic states may incur format-loss warnings.

    Source

    materialize_target_culture

    fn materialize_target_culture(self: &mut Self, culture: &str) -> Result<Vec<EntryId>, StudioError>
    

    Add missing rows for a target culture without replacing existing work. Source/context/plural metadata is copied from the last normalized key; new values and original file review states are cleared.

    Source

    catalog_with_review_states

    fn catalog_with_review_states(self: &Self) -> TranslationCatalog
    

    Explicit review-state projection for workflows that want Studio approvals in the exchange file. The preserved source catalog remains unchanged.

    Source

    entry_diagnostics

    fn entry_diagnostics(self: &Self, id: EntryId) -> Result<Vec<String>, StudioError>
    

    Source

    transaction

    fn transaction<R>(self: &mut Self, action: impl FnOnce(&mut Self) -> Result<R, StudioError>) -> Result<R, StudioError>
    

    One history record for a set of edits. Failed edits leave the document intact.

    Source

    undo

    fn undo(self: &mut Self) -> Result<bool, StudioError>
    

    Source

    redo

    fn redo(self: &mut Self) -> Result<bool, StudioError>
    

    Source

    prepare_translation

    fn prepare_translation(self: &Self, ids: &[EntryId], context: impl Into<String>) -> Result<TranslationPlan, StudioError>
    

    Source

    prepare_missing_translations

    fn prepare_missing_translations(self: &Self, context: impl Into<String>) -> Result<TranslationPlan, StudioError>
    

    Source

    accept_suggestion

    fn accept_suggestion(self: &mut Self, suggestion: &TranslationSuggestion) -> Result<bool, StudioError>
    

    Source

    accept_suggestions

    fn accept_suggestions(self: &mut Self, suggestions: &[TranslationSuggestion]) -> Result<usize, StudioError>
    

    The whole accepted batch is one undo operation. Any stale suggestion rejects the batch before writing, so a later edit can never be lost.

    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.