Skip to main content

stackless_provider_sdk/
observation.rs

1use stackless_core::substrate::Observation;
2
3/// One provider-side setting that differs from what the checkpoint records.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct Drift {
6    pub setting: String,
7    pub expected: String,
8    pub actual: String,
9}
10
11/// What an integration resource looks like when re-checked beyond Stripe
12/// registration. Providers return empty drift until a check-time surface
13/// consumes it.
14#[derive(Debug, Clone, PartialEq, Eq)]
15pub enum IntegrationObservation {
16    Present { drift: Vec<Drift> },
17    Gone,
18}
19
20impl IntegrationObservation {
21    /// Reduce to the substrate/engine boundary type (drift is dropped for now).
22    pub fn into_substrate(self) -> Observation {
23        match self {
24            Self::Present { .. } => Observation::Present,
25            Self::Gone => Observation::Gone,
26        }
27    }
28}