diff --git a/src/ops/factory_bases.rs b/src/ops/factory_bases.rs index 30d96ea2e..3570c7ae5 100644 --- a/src/ops/factory_bases.rs +++ b/src/ops/factory_bases.rs @@ -352,7 +352,7 @@ impl SimpleFunctionFactory for T { pub struct TypedExportDataCollectionBuildOutput { pub export_context: BoxFuture<'static, Result>>, - pub setup_key: F::Key, + pub setup_key: F::SetupKey, pub desired_setup_state: F::SetupState, } pub struct TypedExportDataCollectionSpec { @@ -364,7 +364,7 @@ pub struct TypedExportDataCollectionSpec { } pub struct TypedResourceSetupChangeItem<'a, F: TargetFactoryBase + ?Sized> { - pub key: F::Key, + pub key: F::SetupKey, pub setup_change: &'a F::SetupChange, } @@ -372,9 +372,11 @@ pub struct TypedResourceSetupChangeItem<'a, F: TargetFactoryBase + ?Sized> { pub trait TargetFactoryBase: TargetFactory + Send + Sync + 'static { type Spec: DeserializeOwned + Send + Sync; type DeclarationSpec: DeserializeOwned + Send + Sync; - type Key: Debug + Clone + Serialize + DeserializeOwned + Eq + Hash + Send + Sync; + + type SetupKey: Debug + Clone + Serialize + DeserializeOwned + Eq + Hash + Send + Sync; type SetupState: Debug + Clone + Serialize + DeserializeOwned + Send + Sync; type SetupChange: ResourceSetupChange; + type ExportContext: Send + Sync + 'static; fn name(&self) -> &str; @@ -386,12 +388,12 @@ pub trait TargetFactoryBase: TargetFactory + Send + Sync + 'static { context: Arc, ) -> Result<( Vec>, - Vec<(Self::Key, Self::SetupState)>, + Vec<(Self::SetupKey, Self::SetupState)>, )>; /// Deserialize the setup key from a JSON value. /// You can override this method to provide a custom deserialization logic, e.g. to perform backward compatible deserialization. - fn deserialize_setup_key(key: serde_json::Value) -> Result { + fn deserialize_setup_key(key: serde_json::Value) -> Result { Ok(serde_json::from_value(key)?) } @@ -399,7 +401,7 @@ pub trait TargetFactoryBase: TargetFactory + Send + Sync + 'static { /// It returns an error if the target only supports setup by user. async fn diff_setup_states( &self, - key: Self::Key, + key: Self::SetupKey, desired_state: Option, existing_states: setup::CombinedState, flow_instance_ctx: Arc, @@ -411,7 +413,7 @@ pub trait TargetFactoryBase: TargetFactory + Send + Sync + 'static { existing_state: &Self::SetupState, ) -> Result; - fn describe_resource(&self, key: &Self::Key) -> Result; + fn describe_resource(&self, key: &Self::SetupKey) -> Result; fn extract_additional_key( &self, @@ -504,7 +506,7 @@ impl TargetFactory for T { existing_states: setup::CombinedState, flow_instance_ctx: Arc, ) -> Result> { - let key: T::Key = Self::deserialize_setup_key(key.clone())?; + let key: T::SetupKey = Self::deserialize_setup_key(key.clone())?; let desired_state: Option = desired_state .map(|v| serde_json::from_value(v.clone())) .transpose()?; @@ -521,12 +523,12 @@ impl TargetFactory for T { } fn describe_resource(&self, key: &serde_json::Value) -> Result { - let key: T::Key = Self::deserialize_setup_key(key.clone())?; + let key: T::SetupKey = Self::deserialize_setup_key(key.clone())?; TargetFactoryBase::describe_resource(self, &key) } fn normalize_setup_key(&self, key: &serde_json::Value) -> Result { - let key: T::Key = Self::deserialize_setup_key(key.clone())?; + let key: T::SetupKey = Self::deserialize_setup_key(key.clone())?; Ok(serde_json::to_value(key)?) } diff --git a/src/ops/targets/kuzu.rs b/src/ops/targets/kuzu.rs index 0144293cd..346c89535 100644 --- a/src/ops/targets/kuzu.rs +++ b/src/ops/targets/kuzu.rs @@ -745,7 +745,7 @@ impl TargetFactoryBase for Factory { type SetupState = SetupState; type SetupChange = GraphElementDataSetupChange; - type Key = KuzuGraphElement; + type SetupKey = KuzuGraphElement; type ExportContext = ExportContext; fn name(&self) -> &str { diff --git a/src/ops/targets/neo4j.rs b/src/ops/targets/neo4j.rs index f8a88e847..f77ea49bf 100644 --- a/src/ops/targets/neo4j.rs +++ b/src/ops/targets/neo4j.rs @@ -926,7 +926,7 @@ impl TargetFactoryBase for Factory { GraphElementDataSetupChange, components::SetupChange, ); - type Key = Neo4jGraphElement; + type SetupKey = Neo4jGraphElement; type ExportContext = ExportContext; fn name(&self) -> &str { diff --git a/src/ops/targets/postgres.rs b/src/ops/targets/postgres.rs index 80a1580a7..0ebcb3ad0 100644 --- a/src/ops/targets/postgres.rs +++ b/src/ops/targets/postgres.rs @@ -656,7 +656,7 @@ impl TargetFactoryBase for Factory { type DeclarationSpec = (); type SetupState = SetupState; type SetupChange = SetupChange; - type Key = TableId; + type SetupKey = TableId; type ExportContext = ExportContext; fn name(&self) -> &str { diff --git a/src/ops/targets/qdrant.rs b/src/ops/targets/qdrant.rs index a7e9006b8..dd0bfc96e 100644 --- a/src/ops/targets/qdrant.rs +++ b/src/ops/targets/qdrant.rs @@ -368,7 +368,7 @@ impl TargetFactoryBase for Factory { type DeclarationSpec = (); type SetupState = SetupState; type SetupChange = SetupChange; - type Key = CollectionKey; + type SetupKey = CollectionKey; type ExportContext = ExportContext; fn name(&self) -> &str {