#[non_exhaustive]pub struct ContextReference {
pub context_contents: Vec<ContextContent>,
pub update_mode: UpdateMode,
pub language_code: String,
pub create_time: Option<Timestamp>,
/* private fields */
}Available on crate feature
conversations only.Expand description
Represents a section of ingested context information.
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.context_contents: Vec<ContextContent>Required. The list of content updates for a context reference.
update_mode: UpdateModeRequired. The mode in which context reference contents are updated.
language_code: StringOptional. The language of the information ingested, defaults to “en-US” if not set.
create_time: Option<Timestamp>Output only. The time the context reference was first created.
Implementations§
Source§impl ContextReference
impl ContextReference
pub fn new() -> Self
Sourcepub fn set_context_contents<T, V>(self, v: T) -> Self
pub fn set_context_contents<T, V>(self, v: T) -> Self
Sets the value of context_contents.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::conversation::context_reference::ContextContent;
let x = ContextReference::new()
.set_context_contents([
ContextContent::default()/* use setters */,
ContextContent::default()/* use (different) setters */,
]);Sourcepub fn set_update_mode<T: Into<UpdateMode>>(self, v: T) -> Self
pub fn set_update_mode<T: Into<UpdateMode>>(self, v: T) -> Self
Sets the value of update_mode.
§Example
ⓘ
use google_cloud_dialogflow_v2::model::conversation::context_reference::UpdateMode;
let x0 = ContextReference::new().set_update_mode(UpdateMode::Append);
let x1 = ContextReference::new().set_update_mode(UpdateMode::Overwrite);Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
ⓘ
let x = ContextReference::new().set_language_code("example");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 = ContextReference::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 = ContextReference::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = ContextReference::new().set_or_clear_create_time(None::<Timestamp>);Trait Implementations§
Source§impl Clone for ContextReference
impl Clone for ContextReference
Source§fn clone(&self) -> ContextReference
fn clone(&self) -> ContextReference
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 ContextReference
impl Debug for ContextReference
Source§impl Default for ContextReference
impl Default for ContextReference
Source§fn default() -> ContextReference
fn default() -> ContextReference
Returns the “default value” for a type. Read more
Source§impl Message for ContextReference
impl Message for ContextReference
Source§impl PartialEq for ContextReference
impl PartialEq for ContextReference
impl StructuralPartialEq for ContextReference
Auto Trait Implementations§
impl Freeze for ContextReference
impl RefUnwindSafe for ContextReference
impl Send for ContextReference
impl Sync for ContextReference
impl Unpin for ContextReference
impl UnsafeUnpin for ContextReference
impl UnwindSafe for ContextReference
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