pub enum StateScope {
User,
Context,
Temp,
}Expand description
How long a remembered value lives, taken from the key’s prefix.
The prefix is part of the key the model writes and reads back, so the scope
is visible wherever the key is — in the prompt, in a forget call, and in
the store. Taken from Google ADK, which spells the same three this way.
Variants§
User
user: — filed under the authenticated principal, so every context that
principal opens reads it back.
Requires an authenticator. With no principal there is nothing to file it under, and storing it against the context instead would promise a lifetime it does not have.
Context
No prefix — filed under this context, and read back only here.
Temp
temp: — not stored anywhere.
It exists so the prefix means something: without it, temp:draft would
be an ordinary key that outlives the turn under a name saying it does
not.
Implementations§
Trait Implementations§
Source§impl Clone for StateScope
impl Clone for StateScope
Source§fn clone(&self) -> StateScope
fn clone(&self) -> StateScope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StateScope
Source§impl Debug for StateScope
impl Debug for StateScope
impl Eq for StateScope
Source§impl Hash for StateScope
impl Hash for StateScope
Source§impl Ord for StateScope
impl Ord for StateScope
Source§fn cmp(&self, other: &StateScope) -> Ordering
fn cmp(&self, other: &StateScope) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for StateScope
impl PartialEq for StateScope
Source§impl PartialOrd for StateScope
impl PartialOrd for StateScope
impl StructuralPartialEq for StateScope
Auto Trait Implementations§
impl Freeze for StateScope
impl RefUnwindSafe for StateScope
impl Send for StateScope
impl Sync for StateScope
impl Unpin for StateScope
impl UnsafeUnpin for StateScope
impl UnwindSafe for StateScope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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 more