pub struct AddonModify { /* private fields */ }Expand description
In-memory draft for modifying an instance’s addon order and patch modes with zero-I/O
PatchTrace previewing before committing changes to disk.
Implementations§
Source§impl AddonModify
impl AddonModify
Sourcepub async fn load(instance: InstanceStorage) -> Result<Self>
pub async fn load(instance: InstanceStorage) -> Result<Self>
Loads the clean metadata baseline and persisted addon state for instance.
Sourcepub fn patch_mode(&self) -> PatchMode
pub fn patch_mode(&self) -> PatchMode
Returns the draft instance-wide PatchMode policy.
Sourcepub fn addons(&self) -> Vec<InstalledAddon>
pub fn addons(&self) -> Vec<InstalledAddon>
Returns the current draft addon list with effective patch modes resolved.
Sourcepub fn trace(&self) -> Result<PatchTrace>
pub fn trace(&self) -> Result<PatchTrace>
Computes the current PatchTrace in memory without touching disk.
Sourcepub fn trace_with_extra(
&self,
extra_patches: &[NamedMetadataPatch],
) -> Result<PatchTrace>
pub fn trace_with_extra( &self, extra_patches: &[NamedMetadataPatch], ) -> Result<PatchTrace>
Computes the PatchTrace in memory with additional ephemeral patches appended
(for example launch-scoped addons such as authlib-injector).
Sourcepub fn reorder(&mut self, ordered_ids: &[&str]) -> Result<PatchTrace>
pub fn reorder(&mut self, ordered_ids: &[&str]) -> Result<PatchTrace>
Updates the preferred addon order in the draft and returns the resulting PatchTrace.
IDs listed in ordered_ids are placed first in that exact order; any remaining
installed addons retain their existing relative order afterwards.
Sourcepub fn set_instance_patch_mode(&mut self, mode: PatchMode) -> Result<PatchTrace>
pub fn set_instance_patch_mode(&mut self, mode: PatchMode) -> Result<PatchTrace>
Updates the draft instance-wide PatchMode policy and returns the resulting PatchTrace.
Sourcepub fn set_addon_patch_mode(
&mut self,
addon_id: &str,
mode: AddonPatchMode,
) -> Result<PatchTrace>
pub fn set_addon_patch_mode( &mut self, addon_id: &str, mode: AddonPatchMode, ) -> Result<PatchTrace>
Updates a single addon’s AddonPatchMode preference in the draft and returns the resulting PatchTrace.
Sourcepub fn discard(&mut self) -> Result<PatchTrace>
pub fn discard(&mut self) -> Result<PatchTrace>
Discards all uncommitted draft changes and returns the restored PatchTrace.
Sourcepub async fn commit(&mut self) -> Result<PatchTrace>
pub async fn commit(&mut self) -> Result<PatchTrace>
Persists the draft addon state and syncs physical/virtual metadata patches to disk.