pub struct SessionConfig {
pub timeout: Duration,
pub reset_keywords: Vec<String>,
pub command_prefix: Option<String>,
pub reset_commands: Vec<String>,
pub reset_reply: String,
}Available on crate feature
channels only.Expand description
Session configuration
Fields§
§timeout: DurationSession timeout duration (default: 60 minutes)
reset_keywords: Vec<String>Reset keyword list (exact match, case-insensitive, Unicode-aware)
command_prefix: Option<String>Reset command prefix (messages starting with this are treated as commands, e.g. “/”)
reset_commands: Vec<String>Command name list (used with command_prefix, e.g. [“reset”, “clear”, “new”])
reset_reply: StringReply text after reset
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn with_timeout_minutes(self, minutes: u64) -> SessionConfig
pub fn with_timeout_minutes(self, minutes: u64) -> SessionConfig
Set timeout in minutes
Sourcepub fn with_timeout(self, timeout: Duration) -> SessionConfig
pub fn with_timeout(self, timeout: Duration) -> SessionConfig
Set timeout duration
Sourcepub fn with_reset_keywords(self, keywords: Vec<String>) -> SessionConfig
pub fn with_reset_keywords(self, keywords: Vec<String>) -> SessionConfig
Set reset keywords (replaces defaults)
Sourcepub fn add_reset_keyword(self, keyword: impl Into<String>) -> SessionConfig
pub fn add_reset_keyword(self, keyword: impl Into<String>) -> SessionConfig
Add a reset keyword
Sourcepub fn with_command_prefix(self, prefix: Option<String>) -> SessionConfig
pub fn with_command_prefix(self, prefix: Option<String>) -> SessionConfig
Set the command prefix (None disables command mode)
Sourcepub fn with_reset_commands(self, commands: Vec<String>) -> SessionConfig
pub fn with_reset_commands(self, commands: Vec<String>) -> SessionConfig
Set reset command list (replaces defaults)
Sourcepub fn with_reset_reply(self, reply: impl Into<String>) -> SessionConfig
pub fn with_reset_reply(self, reply: impl Into<String>) -> SessionConfig
Set the reply text after reset
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
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 Default for SessionConfig
impl Default for SessionConfig
Source§fn default() -> SessionConfig
fn default() -> SessionConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request