pub struct ProgramPlugin { /* private fields */ }Expand description
Plugin that extends or replaces the model-visible program tool catalog.
This is the lightweight asset path for PTC templates: callers can package
ProgramTemplate values with a plugin and mount them per session without
writing a new tool.
Implementations§
Source§impl ProgramPlugin
impl ProgramPlugin
pub fn new(name: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_template(self, template: ProgramTemplate) -> Self
pub fn with_templates( self, templates: impl IntoIterator<Item = ProgramTemplate>, ) -> Self
pub fn without_builtin_programs(self) -> Self
pub fn from_json(name: impl Into<String>, content: &str) -> Result<Self>
pub fn from_yaml(name: impl Into<String>, content: &str) -> Result<Self>
Trait Implementations§
Source§impl Plugin for ProgramPlugin
impl Plugin for ProgramPlugin
Source§fn tool_names(&self) -> &[&str]
fn tool_names(&self) -> &[&str]
Names of all tools this plugin registers. Read more
Source§fn load(&self, registry: &Arc<ToolRegistry>, _ctx: &PluginContext) -> Result<()>
fn load(&self, registry: &Arc<ToolRegistry>, _ctx: &PluginContext) -> Result<()>
Register this plugin’s tools into
registry. Read moreSource§fn unload(&self, registry: &Arc<ToolRegistry>)
fn unload(&self, registry: &Arc<ToolRegistry>)
Remove this plugin’s tools from
registry. Read moreSource§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown in plugin listings.
Auto Trait Implementations§
impl Freeze for ProgramPlugin
impl RefUnwindSafe for ProgramPlugin
impl Send for ProgramPlugin
impl Sync for ProgramPlugin
impl Unpin for ProgramPlugin
impl UnsafeUnpin for ProgramPlugin
impl UnwindSafe for ProgramPlugin
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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