#[non_exhaustive]pub struct ContextContent {
pub content: String,
pub content_format: ContentFormat,
pub ingestion_time: Option<Timestamp>,
pub answer_record: String,
/* private fields */
}Available on crate feature
conversations only.Expand description
Contents ingested.
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.content: StringRequired. The information ingested in a single request.
content_format: ContentFormatRequired. The format of the ingested string.
ingestion_time: Option<Timestamp>Output only. The time when this information was incorporated into the relevant context reference.
answer_record: StringIf the context content was generated from a tool call, specify the
answer record associated with the tool call.
Format: projects/<Project ID>/locations/<Location ID>/answerRecords/<Answer Record ID>.
Implementations§
Source§impl ContextContent
impl ContextContent
pub fn new() -> Self
Sourcepub fn set_content<T: Into<String>>(self, v: T) -> Self
pub fn set_content<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_content_format<T: Into<ContentFormat>>(self, v: T) -> Self
pub fn set_content_format<T: Into<ContentFormat>>(self, v: T) -> Self
Sets the value of content_format.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::conversation::context_reference::context_content::ContentFormat;
let x0 = ContextContent::new().set_content_format(ContentFormat::Json);
let x1 = ContextContent::new().set_content_format(ContentFormat::PlainText);Sourcepub fn set_ingestion_time<T>(self, v: T) -> Self
pub fn set_ingestion_time<T>(self, v: T) -> Self
Sets the value of ingestion_time.
§Example
ⓘ
use wkt::Timestamp;
let x = ContextContent::new().set_ingestion_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_ingestion_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ingestion_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of ingestion_time.
§Example
ⓘ
use wkt::Timestamp;
let x = ContextContent::new().set_or_clear_ingestion_time(Some(Timestamp::default()/* use setters */));
let x = ContextContent::new().set_or_clear_ingestion_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 = ContextContent::new().set_answer_record("example");Trait Implementations§
Source§impl Clone for ContextContent
impl Clone for ContextContent
Source§fn clone(&self) -> ContextContent
fn clone(&self) -> ContextContent
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 ContextContent
impl Debug for ContextContent
Source§impl Default for ContextContent
impl Default for ContextContent
Source§fn default() -> ContextContent
fn default() -> ContextContent
Returns the “default value” for a type. Read more
Source§impl Message for ContextContent
impl Message for ContextContent
Source§impl PartialEq for ContextContent
impl PartialEq for ContextContent
impl StructuralPartialEq for ContextContent
Auto Trait Implementations§
impl Freeze for ContextContent
impl RefUnwindSafe for ContextContent
impl Send for ContextContent
impl Sync for ContextContent
impl Unpin for ContextContent
impl UnsafeUnpin for ContextContent
impl UnwindSafe for ContextContent
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