pub trait PluginCategory {
type BoxType;
type InitFnType;
// Required methods
fn configurations(cfg: &Config) -> &[Value];
fn bundled_impl(name: &str) -> Option<Self::BoxType>;
fn do_setup(
ptr: &mut Self::BoxType,
settings: &Value,
config: &Config,
grammar: &mut Grammar<'_>,
) -> SudachiResult<()>;
}
Expand description
A category of Plugins
Required Associated Types§
sourcetype InitFnType
type InitFnType
Type of the initialization function.
It must take 0 arguments and return SudachiResult<Self::BoxType>
.
Required Methods§
sourcefn configurations(cfg: &Config) -> &[Value]
fn configurations(cfg: &Config) -> &[Value]
Extract plugin configurations from the config
sourcefn bundled_impl(name: &str) -> Option<Self::BoxType>
fn bundled_impl(name: &str) -> Option<Self::BoxType>
Create bundled plugin for plugin name Instead of full name like com.worksap.nlp.sudachi.ProlongedSoundMarkPlugin should handle only the short one: ProlongedSoundMarkPlugin
com.worksap.nlp.sudachi. (last dot included) will be stripped automatically by the loader code
Object Safety§
This trait is not object safe.