FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AiTranslationManager

    struct · ferroui-protranslate-studio · v0.5.0

    struct AiTranslationManager
    

    Stable provider ordering matches the source manager. Errors never trigger paid retries.

    View source

    Members

    new

    fn new(transport: Rc<dyn AiTransport>) -> Self
    

    Source

    configure

    fn configure(self: &mut Self, configuration: AiProviderConfig) -> Result<(), StudioError>
    

    Source

    apply_settings

    fn apply_settings(self: &mut Self, configurations: &[AiProviderConfig]) -> Result<(), StudioError>
    

    Validate the entire update before replacing any configuration.

    Source

    providers

    fn providers(self: &Self) -> &[AiProvider; 3]
    

    Source

    configured_providers

    fn configured_providers(self: &Self) -> Vec<AiProvider>
    

    Source

    configuration

    fn configuration(self: &Self, provider: AiProvider) -> &AiProviderConfig
    

    Source

    translate_with_provider

    async fn translate_with_provider(self: &Self, provider: AiProvider, request: &AiTranslationRequest, cancellation: &CancellationToken) -> Result<AiTranslationResult, StudioError>
    

    Source

    translate_with_best_available

    async fn translate_with_best_available(self: &Self, request: &AiTranslationRequest, cancellation: &CancellationToken) -> Result<AiTranslationResult, StudioError>
    

    Source

    translate_single

    async fn translate_single(self: &Self, provider: AiProvider, source_text: &str, source_language: &str, target_language: &str, context: &str, cancellation: &CancellationToken) -> Result<String, StudioError>
    

    Source

    test_connection

    async fn test_connection(self: &Self, provider: AiProvider, cancellation: &CancellationToken) -> Result<bool, StudioError>
    

    Source

    translate_batches

    async fn translate_batches(self: &Self, provider: AiProvider, request: &AiTranslationRequest, batch_size: usize, cancellation: &CancellationToken, progress: &mut dyn FnMut(AiBatchProgress, &AiTranslationResult) -> ()) -> Result<AiBatchResult, StudioError>
    

    Source

    list_models

    async fn list_models(self: &Self, provider: AiProvider, cancellation: &CancellationToken) -> Result<AiModelList, StudioError>
    

    Discover current models without requiring a model selection. Failed or incomplete discovery is an error; an empty successful listing remains empty.

    Source

    compatibility_model_list

    fn compatibility_model_list(provider: AiProvider) -> AiModelList
    

    Explicit access to the original application's historical model list. This performs no discovery, implies no availability, and changes no configuration.

    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.