using System.Runtime.Loader; using AcDream.Plugin.Abstractions; namespace AcDream.Core.Plugins; /// /// Outcome of a plugin load attempt. /// On success, is the instantiated plugin, /// owns its assembly, and is null. /// On failure, describes what went wrong. A partial /// 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) { public bool Success => Plugin is not null && LoadContext is not null && Error is null; }