Skip to main content

ProcessTextService

Trait ProcessTextService 

Source
pub trait ProcessTextService {
    // Required methods
    fn query_text_actions(&self, app: &App) -> Vec<ProcessTextAction>;
    fn process_text_action(
        &self,
        app: &App,
        id: &str,
        text: &str,
        read_only: bool,
    ) -> Option<String>;
}
Expand description

Determines how to interact with the text processing feature.

Required Methods§

Source

fn query_text_actions(&self, app: &App) -> Vec<ProcessTextAction>

Returns a Vec of ProcessTextActions containing all text processing actions available.

If there are no actions available, an empty list will be returned.

Source

fn process_text_action( &self, app: &App, id: &str, text: &str, read_only: bool, ) -> Option<String>

Returns a String when the text action returns a transformed text or None when the text action did not return a transformed text.

The id parameter is the text action unique identifier returned by query_text_actions.

The text parameter is the text to be processed.

The read_only parameter indicates that the transformed text, if it exists, will be used as read-only.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§