Skip to main content

Addon

Trait Addon 

Source
pub trait Addon: Send + Sync {
    // Required method
    fn descriptor(&self) -> AddonDescriptor;

    // Provided methods
    fn patch_mode_support(&self) -> PatchModeSupport { ... }
    fn requires_runtime_hook(&self) -> bool { ... }
    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 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 check_compatibility(&self, _ctx: &AddonContext<'_>) -> AddonCompatibility { ... }
    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 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 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 { ... }
}
Expand description

Composable, host-aware extension layered onto a Minecraft instance.

Required Methods§

Source

fn descriptor(&self) -> AddonDescriptor

Returns the addon’s unique identifier and display name.

Provided Methods§

Source

fn patch_mode_support(&self) -> PatchModeSupport

Declares which patch modes this addon supports.

Source

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,

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,

Returns available addon releases for a host driver and game version, or None when this addon does not provide a version catalog.

Source

fn check_compatibility(&self, _ctx: &AddonContext<'_>) -> AddonCompatibility

Checks whether this addon is compatible with the host driver and game version.

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,

Detects whether an unmanaged/external copy of this addon is already present in probe.

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,

Downloads any required artifacts and produces the metadata patch and managed files to persist for this addon.

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,

Augments the launch command with dynamic JVM or game arguments before spawning.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Addon + ?Sized> Addon for Arc<T>

Source§

fn descriptor(&self) -> AddonDescriptor

Source§

fn patch_mode_support(&self) -> PatchModeSupport

Source§

fn requires_runtime_hook(&self) -> bool

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,

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,

Source§

fn check_compatibility(&self, ctx: &AddonContext<'_>) -> AddonCompatibility

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,

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,

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,

Implementors§