pub struct CallToolRequest {
pub method: String,
pub params: CallToolRequestParams,
}Expand description
Inner content of a tools/call request (method name and parameters).
This struct models the {method, params} payload. The JSON-RPC envelope
containing jsonrpc, id, and _meta is wrapped by JsonRpcRequest from
the turul-rpc crate.
Fields§
§method: StringMethod name (always “tools/call”)
params: CallToolRequestParamsRequest parameters
Implementations§
Source§impl CallToolRequest
impl CallToolRequest
Sourcepub fn new(name: impl Into<String>, meta: RequestMetaObject) -> CallToolRequest
pub fn new(name: impl Into<String>, meta: RequestMetaObject) -> CallToolRequest
Construct with the required _meta and tool name.
Sourcepub fn with_params(self, params: CallToolRequestParams) -> CallToolRequest
pub fn with_params(self, params: CallToolRequestParams) -> CallToolRequest
Attach a fully-constructed params struct.
pub fn with_arguments( self, arguments: HashMap<String, Value>, ) -> CallToolRequest
pub fn with_arguments_value(self, arguments: Value) -> CallToolRequest
pub fn with_meta(self, meta: RequestMetaObject) -> CallToolRequest
Trait Implementations§
Source§impl Clone for CallToolRequest
impl Clone for CallToolRequest
Source§fn clone(&self) -> CallToolRequest
fn clone(&self) -> CallToolRequest
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 moreSource§impl Debug for CallToolRequest
impl Debug for CallToolRequest
Source§impl<'de> Deserialize<'de> for CallToolRequest
impl<'de> Deserialize<'de> for CallToolRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallToolRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CallToolRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CallToolRequest
impl Serialize for CallToolRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for CallToolRequest
impl RefUnwindSafe for CallToolRequest
impl Send for CallToolRequest
impl Sync for CallToolRequest
impl Unpin for CallToolRequest
impl UnsafeUnpin for CallToolRequest
impl UnwindSafe for CallToolRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
Source§fn into_response(self) -> FunctionResponse<B, Body>
fn into_response(self) -> FunctionResponse<B, Body>
Convert the type into a FunctionResponse.