pub struct CaptureOrchestrator {
capture: Option<CaptureService>,
dedup: Option<Arc<dyn Deduplicator>>,
}Expand description
Orchestrates capture operations with deduplication support.
Fields§
§capture: Option<CaptureService>Capture service instance.
dedup: Option<Arc<dyn Deduplicator>>Deduplication service instance (trait object for flexibility).
Implementations§
Source§impl CaptureOrchestrator
impl CaptureOrchestrator
Sourcepub fn with_capture(self, capture: CaptureService) -> Self
pub fn with_capture(self, capture: CaptureService) -> Self
Sets the capture service.
Sourcepub fn with_deduplication(self, dedup: Arc<dyn Deduplicator>) -> Self
pub fn with_deduplication(self, dedup: Arc<dyn Deduplicator>) -> Self
Sets the deduplication service.
Sourcepub fn has_deduplication(&self) -> bool
pub fn has_deduplication(&self) -> bool
Returns whether deduplication is configured.
This method is primarily used in tests to verify builder configuration.
Sourcepub fn capture_candidates(
&self,
candidates: Vec<CaptureCandidate>,
) -> (Vec<CapturedMemory>, Vec<SkippedDuplicate>)
pub fn capture_candidates( &self, candidates: Vec<CaptureCandidate>, ) -> (Vec<CapturedMemory>, Vec<SkippedDuplicate>)
Performs the actual capture of candidates.
If a deduplication service is configured, checks each candidate for duplicates before capture. Returns both captured memories and skipped duplicates.
Note: If no capture service is configured, this method returns empty results
and logs a debug message. Configure a capture service using [with_capture].
Sourcefn check_for_duplicate(
&self,
candidate: &CaptureCandidate,
) -> Option<SkippedDuplicate>
fn check_for_duplicate( &self, candidate: &CaptureCandidate, ) -> Option<SkippedDuplicate>
Checks if a candidate is a duplicate and returns skip info if so.
Returns Some(SkippedDuplicate) if the candidate should be skipped,
None if it should be captured.
Sourcefn record_capture_for_dedup(&self, content: &str, memory_id: &MemoryId)
fn record_capture_for_dedup(&self, content: &str, memory_id: &MemoryId)
Records a successful capture in the deduplication service.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CaptureOrchestrator
impl !RefUnwindSafe for CaptureOrchestrator
impl Send for CaptureOrchestrator
impl Sync for CaptureOrchestrator
impl Unpin for CaptureOrchestrator
impl !UnwindSafe for CaptureOrchestrator
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].