#[non_exhaustive]pub struct FunctionTool {
pub input_schema: Option<Struct>,
pub output_schema: Option<Struct>,
pub method_type: MethodType,
/* private fields */
}Available on crate feature
tools only.Expand description
A Function tool describes the functions to be invoked on the client side.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input_schema: Option<Struct>Optional. The JSON schema is encapsulated in a google.protobuf.Struct to describe the input of the function. This input is a JSON object that contains the function’s parameters as properties of the object.
output_schema: Option<Struct>Optional. The JSON schema is encapsulated in a google.protobuf.Struct to describe the output of the function. This output is a JSON object that contains the function’s parameters as properties of the object.
method_type: MethodTypeOptional. The method type of the function. If not specified, the default value is GET.
Implementations§
Source§impl FunctionTool
impl FunctionTool
pub fn new() -> Self
Sourcepub fn set_input_schema<T>(self, v: T) -> Self
pub fn set_input_schema<T>(self, v: T) -> Self
Sets the value of input_schema.
§Example
ⓘ
use wkt::Struct;
let x = FunctionTool::new().set_input_schema(Struct::default()/* use setters */);Sourcepub fn set_or_clear_input_schema<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_input_schema<T>(self, v: Option<T>) -> Self
Sets or clears the value of input_schema.
§Example
ⓘ
use wkt::Struct;
let x = FunctionTool::new().set_or_clear_input_schema(Some(Struct::default()/* use setters */));
let x = FunctionTool::new().set_or_clear_input_schema(None::<Struct>);Sourcepub fn set_output_schema<T>(self, v: T) -> Self
pub fn set_output_schema<T>(self, v: T) -> Self
Sets the value of output_schema.
§Example
ⓘ
use wkt::Struct;
let x = FunctionTool::new().set_output_schema(Struct::default()/* use setters */);Sourcepub fn set_or_clear_output_schema<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_output_schema<T>(self, v: Option<T>) -> Self
Sets or clears the value of output_schema.
§Example
ⓘ
use wkt::Struct;
let x = FunctionTool::new().set_or_clear_output_schema(Some(Struct::default()/* use setters */));
let x = FunctionTool::new().set_or_clear_output_schema(None::<Struct>);Sourcepub fn set_method_type<T: Into<MethodType>>(self, v: T) -> Self
pub fn set_method_type<T: Into<MethodType>>(self, v: T) -> Self
Sets the value of method_type.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::tool::MethodType;
let x0 = FunctionTool::new().set_method_type(MethodType::Get);
let x1 = FunctionTool::new().set_method_type(MethodType::Post);
let x2 = FunctionTool::new().set_method_type(MethodType::Put);Trait Implementations§
Source§impl Clone for FunctionTool
impl Clone for FunctionTool
Source§fn clone(&self) -> FunctionTool
fn clone(&self) -> FunctionTool
Returns a duplicate of the value. Read more
1.0.0 · 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 FunctionTool
impl Debug for FunctionTool
Source§impl Default for FunctionTool
impl Default for FunctionTool
Source§fn default() -> FunctionTool
fn default() -> FunctionTool
Returns the “default value” for a type. Read more
Source§impl Message for FunctionTool
impl Message for FunctionTool
Source§impl PartialEq for FunctionTool
impl PartialEq for FunctionTool
impl StructuralPartialEq for FunctionTool
Auto Trait Implementations§
impl Freeze for FunctionTool
impl RefUnwindSafe for FunctionTool
impl Send for FunctionTool
impl Sync for FunctionTool
impl Unpin for FunctionTool
impl UnwindSafe for FunctionTool
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