pub struct LoopDetectionConfig {
pub window_ms: u64,
pub max_history: usize,
pub enable_content_hashing: bool,
pub rate_limit_ms: Option<u64>,
}Expand description
Configuration for loop detection
Fields§
§window_ms: u64Time window for detecting loops (default: 500ms)
max_history: usizeMaximum number of operations to track
enable_content_hashing: boolEnable content hashing for deduplication
rate_limit_ms: Option<u64>Optional rate limit in milliseconds (default: None)
When set, sync operations are throttled to at most one per rate_limit_ms.
This provides belt-and-suspenders protection against rapid clipboard updates
even when loop detection passes.
Implementations§
Source§impl LoopDetectionConfig
impl LoopDetectionConfig
Sourcepub fn with_rate_limit(rate_limit_ms: u64) -> Self
pub fn with_rate_limit(rate_limit_ms: u64) -> Self
Create config with rate limiting enabled
§Example
use lamco_clipboard_core::LoopDetectionConfig;
let config = LoopDetectionConfig::with_rate_limit(200);
assert_eq!(config.rate_limit_ms, Some(200));Trait Implementations§
Source§impl Clone for LoopDetectionConfig
impl Clone for LoopDetectionConfig
Source§fn clone(&self) -> LoopDetectionConfig
fn clone(&self) -> LoopDetectionConfig
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 LoopDetectionConfig
impl Debug for LoopDetectionConfig
Auto Trait Implementations§
impl Freeze for LoopDetectionConfig
impl RefUnwindSafe for LoopDetectionConfig
impl Send for LoopDetectionConfig
impl Sync for LoopDetectionConfig
impl Unpin for LoopDetectionConfig
impl UnwindSafe for LoopDetectionConfig
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