Skip to main content

PluginRegistry

Struct PluginRegistry 

Source
pub struct PluginRegistry { /* private fields */ }
Expand description

3 軸 Plugin を統合管理する immutable registry。

build 後の mutation 不可。 dispatch は scheme / id / kind 文字列引きで O(1)。

Implementations§

Source§

impl PluginRegistry

Source

pub fn builder() -> PluginRegistryBuilder

builder pattern 入口。

Source

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")
Source

pub fn default_for_wire() -> WireResult<Self>

Core 同梱 plugin のみで registry を build する shortcut。 mini-app scheme を含めたい場合は [default_builder_for_wire] を使い、 caller 側で MiniAppAdapter を chain すること。

Source

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 経路)。

Source

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 軸)。

Source

pub fn adapter(&self, scheme: &str) -> Option<&Arc<dyn Adapter>>

scheme literal から adapter を引く。

Source

pub fn engine(&self, id: &str) -> Option<&Arc<dyn TemplateEngine>>

engine id から template engine を引く。

Source

pub fn projection(&self, kind: &str) -> Option<&Arc<dyn ProjectionRenderer>>

kind id から projection を引く。

Source

pub fn schemes(&self) -> Vec<&'static str>

登録済 scheme 一覧 (wire_doctor 表示用)。

Source

pub fn describe(&self) -> Vec<AdapterInfo>

wire_doctor 表示用: 登録 adapter の scheme + filter capability 一覧 (scheme 昇順、既存 schemes と同順序規約)。

Source

pub fn engine_ids(&self) -> Vec<&'static str>

登録済 engine id 一覧。

Source

pub fn projection_kinds(&self) -> Vec<&'static str>

登録済 projection kind 一覧。

Trait Implementations§

Source§

impl Clone for PluginRegistry

Source§

fn clone(&self) -> PluginRegistry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PluginRegistry

Source§

fn default() -> PluginRegistry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more