Trait dprint_core::plugins::AsyncPluginHandler
source · pub trait AsyncPluginHandler: Send + Sync + 'static {
type Configuration: Serialize + Clone + Send + Sync;
// Required methods
fn resolve_config(
&self,
config: ConfigKeyMap,
global_config: GlobalConfiguration
) -> ResolveConfigurationResult<Self::Configuration>;
fn plugin_info(&self) -> PluginInfo;
fn license_text(&self) -> String;
fn format(
&self,
request: FormatRequest<Self::Configuration>,
host: Arc<dyn Host>
) -> BoxFuture<'_, FormatResult>;
}
Expand description
Trait for implementing a process plugin. Wasm plugins will eventually be changed to implement this.
Required Associated Types§
Required Methods§
sourcefn resolve_config(
&self,
config: ConfigKeyMap,
global_config: GlobalConfiguration
) -> ResolveConfigurationResult<Self::Configuration>
fn resolve_config( &self, config: ConfigKeyMap, global_config: GlobalConfiguration ) -> ResolveConfigurationResult<Self::Configuration>
Resolves configuration based on the provided config map and global configuration.
sourcefn plugin_info(&self) -> PluginInfo
fn plugin_info(&self) -> PluginInfo
Gets the plugin’s plugin info.
sourcefn license_text(&self) -> String
fn license_text(&self) -> String
Gets the plugin’s license text.
sourcefn format(
&self,
request: FormatRequest<Self::Configuration>,
host: Arc<dyn Host>
) -> BoxFuture<'_, FormatResult>
fn format( &self, request: FormatRequest<Self::Configuration>, host: Arc<dyn Host> ) -> BoxFuture<'_, FormatResult>
Formats the provided file text based on the provided file path and configuration.