pub trait ScriptModule:
Sized
+ Send
+ Sync
+ 'static
+ ScriptModuleFunctions {
// Required methods
fn new(info: AviUtl2Info) -> AnyResult<Self>;
fn plugin_info(&self) -> ScriptModuleTable;
// Provided methods
fn with_instance<R>(f: impl FnOnce(&Self) -> R) -> R
where Self: ScriptModuleSingleton { ... }
fn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> R
where Self: ScriptModuleSingleton { ... }
}Available on crate feature
module only.Expand description
スクリプトモジュールプラグインのトレイト。
このトレイトを実装し、crate::register_script_module! マクロを使用してプラグインを登録します。
Required Methods§
Sourcefn new(info: AviUtl2Info) -> AnyResult<Self>
fn new(info: AviUtl2Info) -> AnyResult<Self>
プラグインを初期化する。
Sourcefn plugin_info(&self) -> ScriptModuleTable
fn plugin_info(&self) -> ScriptModuleTable
プラグインの情報を返す。
Provided Methods§
Sourcefn with_instance<R>(f: impl FnOnce(&Self) -> R) -> Rwhere
Self: ScriptModuleSingleton,
fn with_instance<R>(f: impl FnOnce(&Self) -> R) -> Rwhere
Self: ScriptModuleSingleton,
Sourcefn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> Rwhere
Self: ScriptModuleSingleton,
fn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> Rwhere
Self: ScriptModuleSingleton,
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.