pub struct PluginMetaRegistry(pub RwLock<HashMap<u32, PluginMeta>>, pub RwLock<HashMap<u32, u32>>);Expand description
PI.3/PI.4: host-side plugin-id → PluginMeta map. Backs both provenance
display (SourceLayer::Plugin(id) renders as the manifest name, else
<plugin:id>) and the loaded-plugin introspection surfaces
(:describe-plugin / :list-plugins). A newtype (not a bare
RwLock<HashMap>) so the ServiceRegistry TypeId can’t collide.
Registered empty at boot; the Phase-8 plugin loader is the populator (none
exists yet — the seam is ready). RwLock gives the interior mutability a
post-boot populate needs behind the shared Arc<ServiceRegistry>.
The second map aliases a plugin’s non-primary seam ids to its primary one.
It is separate from the first on purpose: everything that ENUMERATES
plugins (:list-plugins, gen:plugins) reads .0 and must see each
plugin once, while provenance lookups go through Self::primary_of.
Tuple Fields§
§0: RwLock<HashMap<u32, PluginMeta>>§1: RwLock<HashMap<u32, u32>>Implementations§
Source§impl PluginMetaRegistry
impl PluginMetaRegistry
Sourcepub fn primary_of(&self, id: u32) -> u32
pub fn primary_of(&self, id: u32) -> u32
The primary id id belongs to — itself when it is one, or has no alias.
Trait Implementations§
Source§impl Default for PluginMetaRegistry
impl Default for PluginMetaRegistry
Source§impl PluginMetaSink for PluginMetaRegistry
PL8.B: the write seam the plugin loader populates provenance through. The
host registers the same registry instance as a PluginMetaSinkHandle
service; lattice-plugin-loader writes each loaded plugin’s name/doc here so
SourceLayer::Plugin(id) provenance + :list-plugins reflect it — without
the loader naming this host type (dependency-cycle-free, per the sink docs).
impl PluginMetaSink for PluginMetaRegistry
PL8.B: the write seam the plugin loader populates provenance through. The
host registers the same registry instance as a PluginMetaSinkHandle
service; lattice-plugin-loader writes each loaded plugin’s name/doc here so
SourceLayer::Plugin(id) provenance + :list-plugins reflect it — without
the loader naming this host type (dependency-cycle-free, per the sink docs).
Source§fn register_plugin(&self, id: u32, name: String, doc: String)
fn register_plugin(&self, id: u32, name: String, doc: String)
SourceLayer::Plugin(id) provenance renders as the name
and :list-plugins shows it. Called once per plugin at load.Source§fn unregister_plugin(&self, id: u32)
fn unregister_plugin(&self, id: u32)
Auto Trait Implementations§
impl !Freeze for PluginMetaRegistry
impl RefUnwindSafe for PluginMetaRegistry
impl Send for PluginMetaRegistry
impl Sync for PluginMetaRegistry
impl Unpin for PluginMetaRegistry
impl UnsafeUnpin for PluginMetaRegistry
impl UnwindSafe for PluginMetaRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more