#[non_exhaustive]pub struct ToolCallResult {
pub action: String,
pub create_time: Option<Timestamp>,
pub answer_record: String,
pub source: Option<Source>,
pub result: Option<Result>,
/* private fields */
}answer-records or conversations or generator-evaluations or generators or participants only.Expand description
The result of calling a tool’s action.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.action: StringOptional. The name of the tool’s action associated with this call.
create_time: Option<Timestamp>Output only. Create time of the tool call result.
answer_record: StringOptional. The answer record associated with this tool call result.
source: Option<Source>Specifies the source of this tool call.
result: Option<Result>The tool call’s result.
Implementations§
Source§impl ToolCallResult
impl ToolCallResult
pub fn new() -> Self
Sourcepub fn set_action<T: Into<String>>(self, v: T) -> Self
pub fn set_action<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = ToolCallResult::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = ToolCallResult::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = ToolCallResult::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_answer_record<T: Into<String>>(self, v: T) -> Self
pub fn set_answer_record<T: Into<String>>(self, v: T) -> Self
Sets the value of answer_record.
§Example
let x = ToolCallResult::new().set_answer_record("example");Sourcepub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Sourcepub fn tool(&self) -> Option<&String>
pub fn tool(&self) -> Option<&String>
The value of source
if it holds a Tool, None if the field is not set or
holds a different branch.
Sourcepub fn set_result<T: Into<Option<Result>>>(self, v: T) -> Self
pub fn set_result<T: Into<Option<Result>>>(self, v: T) -> Self
Sourcepub fn error(&self) -> Option<&Box<Error>>
pub fn error(&self) -> Option<&Box<Error>>
The value of result
if it holds a Error, None if the field is not set or
holds a different branch.
Sourcepub fn set_error<T: Into<Box<Error>>>(self, v: T) -> Self
pub fn set_error<T: Into<Box<Error>>>(self, v: T) -> Self
Sets the value of result
to hold a Error.
Note that all the setters affecting result are
mutually exclusive.
§Example
use google_cloud_dialogflow_v2::model::tool_call_result::Error;
let x = ToolCallResult::new().set_error(Error::default()/* use setters */);
assert!(x.error().is_some());
assert!(x.raw_content().is_none());
assert!(x.content().is_none());Sourcepub fn raw_content(&self) -> Option<&Bytes>
pub fn raw_content(&self) -> Option<&Bytes>
The value of result
if it holds a RawContent, None if the field is not set or
holds a different branch.
Sourcepub fn set_raw_content<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_raw_content<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of result
to hold a RawContent.
Note that all the setters affecting result are
mutually exclusive.
§Example
let x = ToolCallResult::new().set_raw_content(bytes::Bytes::from_static(b"example"));
assert!(x.raw_content().is_some());
assert!(x.error().is_none());
assert!(x.content().is_none());Sourcepub fn content(&self) -> Option<&String>
pub fn content(&self) -> Option<&String>
The value of result
if it holds a Content, None if the field is not set or
holds a different branch.
Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for ToolCallResult
impl Clone for ToolCallResult
Source§fn clone(&self) -> ToolCallResult
fn clone(&self) -> ToolCallResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more