#[non_exhaustive]pub struct ToolDescriptor { /* private fields */ }Expand description
Tool descriptor — handler + metadata.
#[non_exhaustive]: 미래에 field 추가가 caller code를 깨지 않도록 (codex review 1
권고). 외부에서는 ToolDescriptor::new(handler).with_* builder로만 구성.
Implementations§
Source§impl ToolDescriptor
impl ToolDescriptor
pub fn new<H: ToolHandler + 'static>(handler: H) -> Self
pub fn with_input_schema(self, schema: Value) -> Self
pub fn with_required_permissions(self, perms: Permissions) -> Self
pub fn with_annotations(self, ann: Value) -> Self
pub fn name(&self) -> &str
pub fn description(&self) -> &str
pub fn input_schema(&self) -> Option<&Value>
pub fn required_permissions(&self) -> Permissions
pub fn annotations(&self) -> Option<&Value>
Sourcepub fn handler(&self) -> &Arc<dyn ToolHandler> ⓘ
pub fn handler(&self) -> &Arc<dyn ToolHandler> ⓘ
transport adapter 전용 handler accessor.
SDK consumer는 일반적으로 name/description/... 만 보면 충분.
Trait Implementations§
Source§impl Clone for ToolDescriptor
impl Clone for ToolDescriptor
Source§fn clone(&self) -> ToolDescriptor
fn clone(&self) -> ToolDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ToolDescriptor
impl !UnwindSafe for ToolDescriptor
impl Freeze for ToolDescriptor
impl Send for ToolDescriptor
impl Sync for ToolDescriptor
impl Unpin for ToolDescriptor
impl UnsafeUnpin for ToolDescriptor
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