pub struct PluginRegistry { /* private fields */ }Expand description
3 軸 Plugin を統合管理する immutable registry。
build 後の mutation 不可。 dispatch は scheme / id / kind 文字列引きで O(1)。
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn builder() -> PluginRegistryBuilder
pub fn builder() -> PluginRegistryBuilder
builder pattern 入口。
Sourcepub fn default_builder_for_wire() -> PluginRegistryBuilder
pub fn default_builder_for_wire() -> PluginRegistryBuilder
Core 同梱 plugin の builder を返す convenience 関数。
P3b で mini-app adapter が外部 crate (persona-wire-adapter-mini-app) に分離
されたため、 consumer (persona-wire-mcp / persona-wire bin) は本 builder に
.with_adapter(MiniAppAdapter) を chain して使う。
同梱内訳 (core):
FileAdapter(scheme"file")HandlebarsEngine(id"handlebars")StaticProjection(kind"static")
Sourcepub fn default_for_wire() -> WireResult<Self>
pub fn default_for_wire() -> WireResult<Self>
Core 同梱 plugin のみで registry を build する shortcut。
mini-app scheme を含めたい場合は [default_builder_for_wire] を使い、
caller 側で MiniAppAdapter を chain すること。
Sourcepub fn adapter_for_uri(&self, source_uri: &str) -> Option<&Arc<dyn Adapter>>
pub fn adapter_for_uri(&self, source_uri: &str) -> Option<&Arc<dyn Adapter>>
source_uri の scheme prefix に該当する adapter を引く (parse なし、 lookup のみ)。
未登録 scheme は None。
Adapter の fetch を呼ぶ場合は route を使うこと
(parse + lookup を 1 箇所に集約する canonical 経路)。
Sourcepub fn route(&self, source_uri: &str) -> WireResult<(Arc<dyn Adapter>, WireUri)>
pub fn route(&self, source_uri: &str) -> WireResult<(Arc<dyn Adapter>, WireUri)>
URI grammar parse + scheme dispatch を 1 step で行う canonical entry。
返り値の (adapter, WireUri) をそのまま adapter.fetch(&uri).await に流せる。
scheme 未登録は WireError::Storage (Adapter trait の fetch 失敗と同 error 軸)。
Sourcepub fn adapter(&self, scheme: &str) -> Option<&Arc<dyn Adapter>>
pub fn adapter(&self, scheme: &str) -> Option<&Arc<dyn Adapter>>
scheme literal から adapter を引く。
Sourcepub fn engine(&self, id: &str) -> Option<&Arc<dyn TemplateEngine>>
pub fn engine(&self, id: &str) -> Option<&Arc<dyn TemplateEngine>>
engine id から template engine を引く。
Sourcepub fn projection(&self, kind: &str) -> Option<&Arc<dyn ProjectionRenderer>>
pub fn projection(&self, kind: &str) -> Option<&Arc<dyn ProjectionRenderer>>
kind id から projection を引く。
Sourcepub fn describe(&self) -> Vec<AdapterInfo>
pub fn describe(&self) -> Vec<AdapterInfo>
wire_doctor 表示用: 登録 adapter の scheme + filter capability 一覧
(scheme 昇順、既存 schemes と同順序規約)。
Sourcepub fn engine_ids(&self) -> Vec<&'static str>
pub fn engine_ids(&self) -> Vec<&'static str>
登録済 engine id 一覧。
Sourcepub fn projection_kinds(&self) -> Vec<&'static str>
pub fn projection_kinds(&self) -> Vec<&'static str>
登録済 projection kind 一覧。
Trait Implementations§
Source§impl Clone for PluginRegistry
impl Clone for PluginRegistry
Source§fn clone(&self) -> PluginRegistry
fn clone(&self) -> PluginRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more