pub trait SyncPluginHandler<TConfiguration: Clone + Serialize> {
    // Required methods
    fn resolve_config(
        &mut self,
        config: ConfigKeyMap,
        global_config: &GlobalConfiguration
    ) -> ResolveConfigurationResult<TConfiguration>;
    fn plugin_info(&mut self) -> PluginInfo;
    fn license_text(&mut self) -> String;
    fn format(
        &mut self,
        file_path: &Path,
        file_text: &str,
        config: &TConfiguration,
        format_with_host: impl FnMut(&Path, String, &ConfigKeyMap) -> FormatResult
    ) -> FormatResult;
}
Expand description

Trait for implementing a Wasm plugin. Eventually this will be combined with AsyncPluginHandler.

Required Methods§

source

fn resolve_config( &mut self, config: ConfigKeyMap, global_config: &GlobalConfiguration ) -> ResolveConfigurationResult<TConfiguration>

Resolves configuration based on the provided config map and global configuration.

source

fn plugin_info(&mut self) -> PluginInfo

Gets the plugin’s plugin info.

source

fn license_text(&mut self) -> String

Gets the plugin’s license text.

source

fn format( &mut self, file_path: &Path, file_text: &str, config: &TConfiguration, format_with_host: impl FnMut(&Path, String, &ConfigKeyMap) -> FormatResult ) -> FormatResult

Formats the provided file text based on the provided file path and configuration.

Implementors§