pub struct CustomPlugin { /* private fields */ }
Expand description
A plugin definition
Implementations§
Source§impl CustomPlugin
impl CustomPlugin
Sourcepub fn with_settings(id: &str, settings: PluginSettings) -> Result<Self>
pub fn with_settings(id: &str, settings: PluginSettings) -> Result<Self>
Create a new plugin definition with more advanced settings
Sourcepub fn from_manifest_file(id: &str, manifest: &str) -> Result<Self>
pub fn from_manifest_file(id: &str, manifest: &str) -> Result<Self>
Create a new plugin definition from manifest file contents
Sourcepub fn from_manifest(id: &str, manifest: &PluginManifest) -> Result<Self>
pub fn from_manifest(id: &str, manifest: &PluginManifest) -> Result<Self>
Create a new plugin definition from a manifest
Sourcepub fn on_load(
&mut self,
f: impl FnOnce(HookContext<'_, OnLoad>, <OnLoad as Hook>::Arg) -> Result<<OnLoad as Hook>::Result>,
) -> Result<()>
pub fn on_load( &mut self, f: impl FnOnce(HookContext<'_, OnLoad>, <OnLoad as Hook>::Arg) -> Result<<OnLoad as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the on_load hook
Sourcepub fn subcommand(
&mut self,
f: impl FnOnce(HookContext<'_, Subcommand>, <Subcommand as Hook>::Arg) -> Result<<Subcommand as Hook>::Result>,
) -> Result<()>
pub fn subcommand( &mut self, f: impl FnOnce(HookContext<'_, Subcommand>, <Subcommand as Hook>::Arg) -> Result<<Subcommand as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the subcommand hook
Sourcepub fn modify_instance_config(
&mut self,
f: impl FnOnce(HookContext<'_, ModifyInstanceConfig>, <ModifyInstanceConfig as Hook>::Arg) -> Result<<ModifyInstanceConfig as Hook>::Result>,
) -> Result<()>
pub fn modify_instance_config( &mut self, f: impl FnOnce(HookContext<'_, ModifyInstanceConfig>, <ModifyInstanceConfig as Hook>::Arg) -> Result<<ModifyInstanceConfig as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the modify_instance_config hook
Sourcepub fn add_versions(
&mut self,
f: impl FnOnce(HookContext<'_, AddVersions>, <AddVersions as Hook>::Arg) -> Result<<AddVersions as Hook>::Result>,
) -> Result<()>
pub fn add_versions( &mut self, f: impl FnOnce(HookContext<'_, AddVersions>, <AddVersions as Hook>::Arg) -> Result<<AddVersions as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the add_versions hook
Sourcepub fn on_instance_setup(
&mut self,
f: impl FnOnce(HookContext<'_, OnInstanceSetup>, <OnInstanceSetup as Hook>::Arg) -> Result<<OnInstanceSetup as Hook>::Result>,
) -> Result<()>
pub fn on_instance_setup( &mut self, f: impl FnOnce(HookContext<'_, OnInstanceSetup>, <OnInstanceSetup as Hook>::Arg) -> Result<<OnInstanceSetup as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the on_instance_setup hook
Sourcepub fn on_instance_launch(
&mut self,
f: impl FnOnce(HookContext<'_, OnInstanceLaunch>, <OnInstanceLaunch as Hook>::Arg) -> Result<<OnInstanceLaunch as Hook>::Result>,
) -> Result<()>
pub fn on_instance_launch( &mut self, f: impl FnOnce(HookContext<'_, OnInstanceLaunch>, <OnInstanceLaunch as Hook>::Arg) -> Result<<OnInstanceLaunch as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the on_instance_launch hook
Sourcepub fn while_instance_launch(
&mut self,
f: impl FnOnce(HookContext<'_, WhileInstanceLaunch>, <WhileInstanceLaunch as Hook>::Arg) -> Result<<WhileInstanceLaunch as Hook>::Result>,
) -> Result<()>
pub fn while_instance_launch( &mut self, f: impl FnOnce(HookContext<'_, WhileInstanceLaunch>, <WhileInstanceLaunch as Hook>::Arg) -> Result<<WhileInstanceLaunch as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the while_instance_launch hook
Sourcepub fn on_instance_stop(
&mut self,
f: impl FnOnce(HookContext<'_, OnInstanceStop>, <OnInstanceStop as Hook>::Arg) -> Result<<OnInstanceStop as Hook>::Result>,
) -> Result<()>
pub fn on_instance_stop( &mut self, f: impl FnOnce(HookContext<'_, OnInstanceStop>, <OnInstanceStop as Hook>::Arg) -> Result<<OnInstanceStop as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the on_instance_stop hook
Sourcepub fn custom_package_instruction(
&mut self,
f: impl FnOnce(HookContext<'_, CustomPackageInstruction>, <CustomPackageInstruction as Hook>::Arg) -> Result<<CustomPackageInstruction as Hook>::Result>,
) -> Result<()>
pub fn custom_package_instruction( &mut self, f: impl FnOnce(HookContext<'_, CustomPackageInstruction>, <CustomPackageInstruction as Hook>::Arg) -> Result<<CustomPackageInstruction as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the custom_package_instruction hook
Sourcepub fn handle_auth(
&mut self,
f: impl FnOnce(HookContext<'_, HandleAuth>, <HandleAuth as Hook>::Arg) -> Result<<HandleAuth as Hook>::Result>,
) -> Result<()>
pub fn handle_auth( &mut self, f: impl FnOnce(HookContext<'_, HandleAuth>, <HandleAuth as Hook>::Arg) -> Result<<HandleAuth as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the handle_auth hook
Sourcepub fn add_translations(
&mut self,
f: impl FnOnce(HookContext<'_, AddTranslations>, <AddTranslations as Hook>::Arg) -> Result<<AddTranslations as Hook>::Result>,
) -> Result<()>
pub fn add_translations( &mut self, f: impl FnOnce(HookContext<'_, AddTranslations>, <AddTranslations as Hook>::Arg) -> Result<<AddTranslations as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the add_translations hook
Sourcepub fn add_instance_transfer_formats(
&mut self,
f: impl FnOnce(HookContext<'_, AddInstanceTransferFormats>, <AddInstanceTransferFormats as Hook>::Arg) -> Result<<AddInstanceTransferFormats as Hook>::Result>,
) -> Result<()>
pub fn add_instance_transfer_formats( &mut self, f: impl FnOnce(HookContext<'_, AddInstanceTransferFormats>, <AddInstanceTransferFormats as Hook>::Arg) -> Result<<AddInstanceTransferFormats as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the add_instance_transfer_formats hook
Sourcepub fn export_instance(
&mut self,
f: impl FnOnce(HookContext<'_, ExportInstance>, <ExportInstance as Hook>::Arg) -> Result<<ExportInstance as Hook>::Result>,
) -> Result<()>
pub fn export_instance( &mut self, f: impl FnOnce(HookContext<'_, ExportInstance>, <ExportInstance as Hook>::Arg) -> Result<<ExportInstance as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the export_instance hook
Sourcepub fn import_instance(
&mut self,
f: impl FnOnce(HookContext<'_, ImportInstance>, <ImportInstance as Hook>::Arg) -> Result<<ImportInstance as Hook>::Result>,
) -> Result<()>
pub fn import_instance( &mut self, f: impl FnOnce(HookContext<'_, ImportInstance>, <ImportInstance as Hook>::Arg) -> Result<<ImportInstance as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the import_instance hook
Sourcepub fn add_supported_game_modifications(
&mut self,
f: impl FnOnce(HookContext<'_, AddSupportedGameModifications>, <AddSupportedGameModifications as Hook>::Arg) -> Result<<AddSupportedGameModifications as Hook>::Result>,
) -> Result<()>
pub fn add_supported_game_modifications( &mut self, f: impl FnOnce(HookContext<'_, AddSupportedGameModifications>, <AddSupportedGameModifications as Hook>::Arg) -> Result<<AddSupportedGameModifications as Hook>::Result>, ) -> Result<()>
Bind to the subcommand hook Bind to the add_supported_game_modifications hook
Auto Trait Implementations§
impl Freeze for CustomPlugin
impl RefUnwindSafe for CustomPlugin
impl !Send for CustomPlugin
impl !Sync for CustomPlugin
impl Unpin for CustomPlugin
impl UnwindSafe for CustomPlugin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more