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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.