using System.Runtime.Loader; using AcDream.Plugin.Abstractions; using AcDream.Plugin.Abstractions.Rendering; namespace AcDream.Core.Plugins; /// /// Outcome of a plugin load attempt. /// On success, at least one of or /// is instantiated, /// owns the assembly, and is null. /// On failure, describes what went wrong. A partial /// entry-point instances and/or may still be present; /// the caller owns their cleanup. The loader never requests collectible unload /// itself because the session must first roll back host registrations. /// public sealed record LoadedPlugin( PluginManifest Manifest, IAcDreamPlugin? Plugin, AssemblyLoadContext? LoadContext, Exception? Error, IRenderPackPlugin? RenderPackPlugin = null) { public bool Success => (Plugin is not null || RenderPackPlugin is not null) && LoadContext is not null && Error is null; }