pub struct CustomPatchAddon { /* private fields */ }Expand description
Addon wrapping a user-provided declarative MetadataPatch.
Implementations§
Source§impl CustomPatchAddon
impl CustomPatchAddon
Sourcepub fn new(
id: impl Into<Cow<'static, str>>,
name: impl Into<Cow<'static, str>>,
patch: MetadataPatch,
) -> Self
pub fn new( id: impl Into<Cow<'static, str>>, name: impl Into<Cow<'static, str>>, patch: MetadataPatch, ) -> Self
Creates an addon that applies patch under the given id and name.
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Sets the default version string recorded when the caller omits one.
Sourcepub fn with_allowed_drivers(self, drivers: Vec<&'static str>) -> Self
pub fn with_allowed_drivers(self, drivers: Vec<&'static str>) -> Self
Restricts compatibility to instances using one of the specified driver IDs.
Trait Implementations§
Source§impl Addon for CustomPatchAddon
impl Addon for CustomPatchAddon
Source§fn descriptor(&self) -> AddonDescriptor
fn descriptor(&self) -> AddonDescriptor
Returns the addon’s unique identifier and display name.
Source§fn check_compatibility(&self, ctx: &AddonContext<'_>) -> AddonCompatibility
fn check_compatibility(&self, ctx: &AddonContext<'_>) -> AddonCompatibility
Checks whether this addon is compatible with the host driver and game version.
Source§fn prepare<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 AddonPrepareRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<AddonPrepareOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn prepare<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 AddonPrepareRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<AddonPrepareOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Downloads any required artifacts and produces the metadata patch and managed files
to persist for this addon.
Source§fn patch_mode_support(&self) -> PatchModeSupport
fn patch_mode_support(&self) -> PatchModeSupport
Declares which patch modes this addon supports.
Source§fn requires_runtime_hook(&self) -> bool
fn requires_runtime_hook(&self) -> bool
Returns
true when this addon requires code execution during launch
command construction (augment_launch) and cannot degrade to data-only.Source§fn supported_game_versions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<GameVersion>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn supported_game_versions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<GameVersion>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns supported game versions when this addon exposes a remote catalog.
Source§fn available_versions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_query: &'life1 AddonCatalogQuery<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<AddonRelease>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn available_versions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_query: &'life1 AddonCatalogQuery<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<AddonRelease>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns available addon releases for a host driver and game version, or
None when this addon does not provide a version catalog.Source§fn inspect<'life0, 'life1, 'async_trait>(
&'life0 self,
_probe: &'life1 InstanceProbe,
) -> Pin<Box<dyn Future<Output = Result<Option<InstalledAddon>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn inspect<'life0, 'life1, 'async_trait>(
&'life0 self,
_probe: &'life1 InstanceProbe,
) -> Pin<Box<dyn Future<Output = Result<Option<InstalledAddon>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Detects whether an unmanaged/external copy of this addon is already present in
probe.Source§fn augment_launch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_args: &'life1 mut AddonLaunchArgs,
_ctx: &'life2 AddonLaunchContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn augment_launch<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_args: &'life1 mut AddonLaunchArgs,
_ctx: &'life2 AddonLaunchContext<'life3>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Augments the launch command with dynamic JVM or game arguments before spawning.
Source§impl Clone for CustomPatchAddon
impl Clone for CustomPatchAddon
Auto Trait Implementations§
impl Forget for CustomPatchAddon
impl Freeze for CustomPatchAddonwhere
&'static str: Freeze,
String: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<PistonMetaLibraries>: Freeze,
PhantomData<PistonMetaGenericArgument>: Freeze,
PhantomData<&'static str>: Freeze,
impl Move for CustomPatchAddon
impl RefUnwindSafe for CustomPatchAddonwhere
String: RefUnwindSafe,
impl Send for CustomPatchAddon
impl Sync for CustomPatchAddon
impl Unpin for CustomPatchAddon
impl UnsafeUnpin for CustomPatchAddonwhere
&'static str: UnsafeUnpin,
String: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<PistonMetaLibraries>: UnsafeUnpin,
PhantomData<PistonMetaGenericArgument>: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
impl UnwindSafe for CustomPatchAddonwhere
&'static str: UnwindSafe,
String: UnwindSafe,
RawVecInner: UnwindSafe,
HashMap<String, PistonMetaLibrariesDownloadsArtifact>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
HashMap<String, String>: UnwindSafe,
HashMap<String, bool>: UnwindSafe,
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
Mutably borrows from an owned value. Read more