pub struct Registry { /* private fields */ }Expand description
Every tool the server offers, before any listener’s policy.
Implementations§
Source§impl Registry
impl Registry
pub fn new() -> Self
Sourcepub fn instructions(self, text: impl Into<String>) -> Self
pub fn instructions(self, text: impl Into<String>) -> Self
The instructions returned from initialize.
Sourcepub fn register(&mut self, tool: Tool) -> Result<()>
pub fn register(&mut self, tool: Tool) -> Result<()>
Add a tool. Names are 1-128 of [A-Za-z0-9_.-] and unique.
pub fn get(&self, name: &str) -> Option<&Tool>
pub fn tools(&self) -> &[Tool]
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Freeze for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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