pub struct SessionConfig {
pub max_turns: Option<u32>,
pub max_entries: Option<usize>,
pub max_duration: Option<Duration>,
pub limit_action: LimitAction,
}Expand description
Configuration for session limits.
Fields§
§max_turns: Option<u32>Maximum number of turns allowed (None = unlimited).
max_entries: Option<usize>Maximum number of entries allowed (None = unlimited).
max_duration: Option<Duration>Maximum session duration (None = unlimited).
limit_action: LimitActionAction to take when limit is reached.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn with_max_turns(self, max: u32) -> Self
pub fn with_max_turns(self, max: u32) -> Self
Set maximum turns.
Sourcepub fn with_max_entries(self, max: usize) -> Self
pub fn with_max_entries(self, max: usize) -> Self
Set maximum entries.
Sourcepub fn with_max_duration(self, max: Duration) -> Self
pub fn with_max_duration(self, max: Duration) -> Self
Set maximum duration.
Sourcepub fn with_limit_action(self, action: LimitAction) -> Self
pub fn with_limit_action(self, action: LimitAction) -> Self
Set limit action.
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 · 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 SessionConfig
impl Debug for SessionConfig
Source§impl Default for SessionConfig
impl Default for SessionConfig
Source§impl<'de> Deserialize<'de> for SessionConfig
impl<'de> Deserialize<'de> for SessionConfig
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 SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin 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