pub struct SelectionContext {
pub conversation_history: Vec<String>,
pub active_skills: Vec<SkillName>,
pub user_locale: Option<String>,
pub custom: HashMap<String, String>,
}Expand description
Context available during selection.
Fields§
§conversation_history: Vec<String>Recent conversation history.
active_skills: Vec<SkillName>Currently active/loaded skills.
user_locale: Option<String>User locale (e.g., “zh-CN”, “en-US”).
custom: HashMap<String, String>Custom context data.
Implementations§
Source§impl SelectionContext
impl SelectionContext
Sourcepub fn with_history(self, history: Vec<String>) -> Self
pub fn with_history(self, history: Vec<String>) -> Self
Add conversation history.
Sourcepub fn with_active_skills(self, skills: Vec<SkillName>) -> Self
pub fn with_active_skills(self, skills: Vec<SkillName>) -> Self
Add active skills.
Sourcepub fn with_locale(self, locale: impl Into<String>) -> Self
pub fn with_locale(self, locale: impl Into<String>) -> Self
Set user locale.
Trait Implementations§
Source§impl Clone for SelectionContext
impl Clone for SelectionContext
Source§fn clone(&self) -> SelectionContext
fn clone(&self) -> SelectionContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SelectionContext
impl Debug for SelectionContext
Source§impl Default for SelectionContext
impl Default for SelectionContext
Source§fn default() -> SelectionContext
fn default() -> SelectionContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SelectionContext
impl<'de> Deserialize<'de> for SelectionContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SelectionContext
impl RefUnwindSafe for SelectionContext
impl Send for SelectionContext
impl Sync for SelectionContext
impl Unpin for SelectionContext
impl UnsafeUnpin for SelectionContext
impl UnwindSafe for SelectionContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().