pub struct PluginRegistry {
pub schema_version: u32,
pub plugins: BTreeMap<String, PluginPin>,
}Expand description
Central registry (<plugins_root>/registry.json).
Fields§
§schema_version: u32Format version.
plugins: BTreeMap<String, PluginPin>Plugin name → pin.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn load(path: &Path) -> Result<Self, RegistryError>
pub fn load(path: &Path) -> Result<Self, RegistryError>
Read the registry. Missing = empty table; corrupt = error (never silently treated as empty — this is the user’s install ledger, and silently clearing it would throw away the anchors of every reviewed plugin).
Sourcepub fn save(&self, path: &Path) -> Result<(), RegistryError>
pub fn save(&self, path: &Path) -> Result<(), RegistryError>
Write back (pure JSON, machine-written; called only by plugin add / plugin remove).
Sourcepub fn path_in(plugins_root: &Path) -> PathBuf
pub fn path_in(plugins_root: &Path) -> PathBuf
Registry path (convenience: registry.json under plugins_root).
Sourcepub fn remove(&mut self, name: &str) -> Option<PluginPin>
pub fn remove(&mut self, name: &str) -> Option<PluginPin>
Pull one plugin’s pin (for plugin remove only).
Sourcepub fn verify(&self, plugin_dir: &Path) -> VerifyReport
pub fn verify(&self, plugin_dir: &Path) -> VerifyReport
Load-time re-verification: pins vs the plugin directory on disk.
- manifest hash mismatch / tool set mismatch / any .wasm swapped → package-level
PackageStatus::Tampered(all tools disabled + “re-run add to re-review”); - .wasm missing → per-tool
ToolStatus::Broken(the package is not skipped); - “manifest unreadable but hash matches” cannot happen (hash = content), so an unreadable manifest means tampering.
Sourcepub fn verify_plugin(&self, name: &str, plugin_dir: &Path) -> VerifyReport
pub fn verify_plugin(&self, name: &str, plugin_dir: &Path) -> VerifyReport
Re-verify an installed plugin by name (used by the loader).
Trait Implementations§
Source§impl Clone for PluginRegistry
impl Clone for PluginRegistry
Source§impl Debug for PluginRegistry
impl Debug for PluginRegistry
Source§impl Default for PluginRegistry
impl Default for PluginRegistry
Source§impl<'de> Deserialize<'de> for PluginRegistry
impl<'de> Deserialize<'de> for PluginRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PluginRegistry
Source§impl PartialEq for PluginRegistry
impl PartialEq for PluginRegistry
Source§impl Serialize for PluginRegistry
impl Serialize for PluginRegistry
impl StructuralPartialEq for PluginRegistry
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
impl UnwindSafe for PluginRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.