struct SourceObservationEntry {
binding: SourceBinding,
watcher: RecommendedWatcher,
receiver: Arc<Mutex<Receiver<Event>>>,
ingress_sequence: Arc<AtomicU64>,
continuity_lost: Arc<AtomicBool>,
reconcile: Mutex<()>,
state: Mutex<ObservationState>,
}Expand description
Concrete watcher and state for one exact source binding.
Fields§
§binding: SourceBindingExact source, database, and configuration identity.
watcher: RecommendedWatcherNative watcher kept alive for the entry lifetime.
receiver: Arc<Mutex<Receiver<Event>>>Bounded receiver whose lock serializes callback publication with drain acknowledgment.
ingress_sequence: Arc<AtomicU64>Monotonic count of relevant events accepted by the callback.
continuity_lost: Arc<AtomicBool>Whether overflow, disconnection, or rescan invalidated event continuity.
reconcile: Mutex<()>Serializes exact verification and epoch installation for this binding.
state: Mutex<ObservationState>Current process-local verified epoch.
Implementations§
Source§impl SourceObservationEntry
impl SourceObservationEntry
Sourcefn start(binding: SourceBinding) -> Result<Self, CliError>
fn start(binding: SourceBinding) -> Result<Self, CliError>
Start a bounded native watcher for one source binding.
Sourcefn invalidate(&self)
fn invalidate(&self)
Discard the current verified epoch after any uncertainty.
Sourcefn invalidate_epoch(&self, epoch: &VerifiedSourceEpoch)
fn invalidate_epoch(&self, epoch: &VerifiedSourceEpoch)
Discard only the failed operation’s epoch without clearing a successor.
Sourcefn invalidate_after_proven_source_mismatch(&self) -> Result<(), CliError>
fn invalidate_after_proven_source_mismatch(&self) -> Result<(), CliError>
Reject all cached and in-flight evidence after exact source verification fails.
Sourcefn clear_before_exact_verification(&self) -> Result<(), CliError>
fn clear_before_exact_verification(&self) -> Result<(), CliError>
Reset continuity and drain events before sampling exact source truth.
Sourcefn changed_since_exact_verification(
&self,
scan_options: &ScanOptions,
) -> Result<bool, CliError>
fn changed_since_exact_verification( &self, scan_options: &ScanOptions, ) -> Result<bool, CliError>
Return whether any potentially relevant event arrived since exact truth was sampled.
Sourcefn drain_source_events(
&self,
receiver: &Receiver<Event>,
scan_options: &ScanOptions,
) -> Result<bool, CliError>
fn drain_source_events( &self, receiver: &Receiver<Event>, scan_options: &ScanOptions, ) -> Result<bool, CliError>
Drain and invalidate atomically with callback publication and epoch installation.
Sourcefn drain_epoch_events(
&self,
receiver: &Receiver<Event>,
epoch: &VerifiedSourceEpoch,
scan_options: &ScanOptions,
) -> Result<ObservedAcceptance, CliError>
fn drain_epoch_events( &self, receiver: &Receiver<Event>, epoch: &VerifiedSourceEpoch, scan_options: &ScanOptions, ) -> Result<ObservedAcceptance, CliError>
Consume events only while the sampled epoch still owns their selection policy.
Sourcefn install_epoch(
&self,
process_nonce: [u8; 16],
binding: &CapturedProjectBinding,
generation: IndexGeneration,
ingress_sequence: u64,
contract_fingerprint: String,
policy_witness: String,
) -> Result<VerifiedSourceEpoch, CliError>
fn install_epoch( &self, process_nonce: [u8; 16], binding: &CapturedProjectBinding, generation: IndexGeneration, ingress_sequence: u64, contract_fingerprint: String, policy_witness: String, ) -> Result<VerifiedSourceEpoch, CliError>
Install a new verified epoch after exact source and policy reconciliation.
Sourcefn current_epoch(&self) -> Result<Option<VerifiedSourceEpoch>, CliError>
fn current_epoch(&self) -> Result<Option<VerifiedSourceEpoch>, CliError>
Clone the current verified epoch without holding the state lock.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SourceObservationEntry
impl RefUnwindSafe for SourceObservationEntry
impl Send for SourceObservationEntry
impl Sync for SourceObservationEntry
impl Unpin for SourceObservationEntry
impl UnsafeUnpin for SourceObservationEntry
impl UnwindSafe for SourceObservationEntry
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> 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