#[non_exhaustive]pub struct SessionConfig {
pub max_error_score_scaled: u32,
pub error_score_decrement_scaled: u32,
pub max_usage_count: u32,
pub max_age: Duration,
}Expand description
Limits and scoring behavior for one session.
Scores use fixed-point thousandths. max_age extends the three-field interface configuration
with Crawlee’s 3,000-second session lifetime.
use millipede_core::session::SessionConfig;
let config = SessionConfig::default().with_max_usage_count(10);
assert_eq!(config.max_usage_count, 10);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_error_score_scaled: u32Blocking threshold, scaled by 1,000.
error_score_decrement_scaled: u32Score removed after a successful use, scaled by 1,000.
max_usage_count: u32Maximum attempts served before retirement.
max_age: DurationMaximum wall-clock lifetime.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn with_max_error_score_scaled(self, value: u32) -> Self
pub fn with_max_error_score_scaled(self, value: u32) -> Self
Sets the scaled blocking threshold.
Sourcepub fn with_error_score_decrement_scaled(self, value: u32) -> Self
pub fn with_error_score_decrement_scaled(self, value: u32) -> Self
Sets the scaled successful-use decrement.
Sourcepub fn with_max_usage_count(self, value: u32) -> Self
pub fn with_max_usage_count(self, value: u32) -> Self
Sets the maximum usage count.
Sourcepub fn with_max_age(self, value: Duration) -> Self
pub fn with_max_age(self, value: Duration) -> Self
Sets the maximum session age.
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 Debug for SessionConfig
impl Debug for SessionConfig
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