#[non_exhaustive]pub struct ConversationContext {
pub context_documents: Vec<String>,
pub active_document: String,
/* private fields */
}Available on crate feature
conversational-search-service only.Expand description
Defines context of the conversation
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_documents: Vec<String>The current list of documents the user is seeing. It contains the document resource references.
active_document: StringThe current active document the user opened. It contains the document resource reference.
Implementations§
Source§impl ConversationContext
impl ConversationContext
pub fn new() -> Self
Sourcepub fn set_context_documents<T, V>(self, v: T) -> Self
pub fn set_context_documents<T, V>(self, v: T) -> Self
Sets the value of context_documents.
§Example
ⓘ
let x = ConversationContext::new().set_context_documents(["a", "b", "c"]);Sourcepub fn set_active_document<T: Into<String>>(self, v: T) -> Self
pub fn set_active_document<T: Into<String>>(self, v: T) -> Self
Sets the value of active_document.
§Example
ⓘ
let x = ConversationContext::new().set_active_document("example");Trait Implementations§
Source§impl Clone for ConversationContext
impl Clone for ConversationContext
Source§fn clone(&self) -> ConversationContext
fn clone(&self) -> ConversationContext
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 ConversationContext
impl Debug for ConversationContext
Source§impl Default for ConversationContext
impl Default for ConversationContext
Source§fn default() -> ConversationContext
fn default() -> ConversationContext
Returns the “default value” for a type. Read more
Source§impl Message for ConversationContext
impl Message for ConversationContext
Source§impl PartialEq for ConversationContext
impl PartialEq for ConversationContext
impl StructuralPartialEq for ConversationContext
Auto Trait Implementations§
impl Freeze for ConversationContext
impl RefUnwindSafe for ConversationContext
impl Send for ConversationContext
impl Sync for ConversationContext
impl Unpin for ConversationContext
impl UnwindSafe for ConversationContext
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