#[non_exhaustive]pub enum Scope {
Ephemeral,
Conversation(String),
Persistent {
ttl: Duration,
},
}Expand description
Persistence scope of a Session’s token manifest.
Scope chooses persistence, not isolation. A Session instance is the
pseudonym namespace boundary; two Sessions never share counters or value-keyed
lookups, regardless of which Scope variant they use.
| Variant | Use case | export() allowed |
|---|---|---|
Ephemeral | Process-bound one-off redaction; namespace lives until the Session is dropped | No |
Conversation(id) | Keyed multi-turn LLM sessions that can be re-opened across process restarts, storage backend-dependent | Yes |
Persistent { ttl: Duration } | Long-lived sessions across restarts | Yes |
Do not share one Scope::Ephemeral Session across logical conversations if
each conversation should start with independent Email_1 / Person_1
counters. Use one Session per logical isolation boundary.
Persistent’s ttl is a std::time::Duration. SensitiveSnapshots exported from a
persistent session carry the TTL; Session::import returns Error::BlobExpired { .. } once
the deadline has elapsed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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,
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 more