Trait dprint_core::plugins::AsyncPluginHandler
source · [−]pub trait AsyncPluginHandler: Send + Sync + 'static {
type Configuration: Serialize + Clone + Send + Sync;
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.
Associated Types
Required methods
fn 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.
fn plugin_info(&self) -> PluginInfo
fn plugin_info(&self) -> PluginInfo
Gets the plugin’s plugin info.
fn license_text(&self) -> String
fn license_text(&self) -> String
Gets the plugin’s license text.
fn 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.