pub struct D1TargetFactory;Expand description
D1 Target Factory for Cloudflare D1 databases
Trait Implementations§
Source§impl Clone for D1TargetFactory
impl Clone for D1TargetFactory
Source§fn clone(&self) -> D1TargetFactory
fn clone(&self) -> D1TargetFactory
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 D1TargetFactory
impl Debug for D1TargetFactory
Source§impl TargetFactoryBase for D1TargetFactory
impl TargetFactoryBase for D1TargetFactory
type Spec = D1Spec
type DeclarationSpec = ()
type SetupKey = D1TableId
type SetupState = D1SetupState
type SetupChange = D1SetupChange
type ExportContext = D1ExportContext
fn name(&self) -> &str
fn build<'async_trait>(
self: Arc<Self>,
data_collections: Vec<TypedExportDataCollectionSpec<Self>>,
_declarations: Vec<Self::DeclarationSpec>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<TypedExportDataCollectionBuildOutput<Self>>, Vec<(Self::SetupKey, Self::SetupState)>), RecocoError>> + Send + 'async_trait>>where
Self: 'async_trait,
Source§fn diff_setup_states<'life0, 'async_trait>(
&'life0 self,
_key: Self::SetupKey,
desired_state: Option<Self::SetupState>,
existing_states: CombinedState<Self::SetupState>,
_flow_instance_ctx: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Self::SetupChange, RecocoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn diff_setup_states<'life0, 'async_trait>(
&'life0 self,
_key: Self::SetupKey,
desired_state: Option<Self::SetupState>,
existing_states: CombinedState<Self::SetupState>,
_flow_instance_ctx: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Self::SetupChange, RecocoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Will not be called if it’s setup by user.
It returns an error if the target only supports setup by user.
fn check_state_compatibility( &self, desired_state: &Self::SetupState, existing_state: &Self::SetupState, ) -> Result<SetupStateCompatibility, RecocoError>
fn describe_resource(&self, key: &Self::SetupKey) -> Result<String, RecocoError>
fn apply_mutation<'life0, 'async_trait>(
&'life0 self,
mutations: Vec<ExportTargetMutationWithContext<'async_trait, Self::ExportContext>>,
) -> Pin<Box<dyn Future<Output = Result<(), RecocoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply_setup_changes<'life0, 'async_trait>(
&'life0 self,
changes: Vec<TypedResourceSetupChangeItem<'async_trait, Self>>,
_context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<(), RecocoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn deserialize_setup_key(key: Value) -> Result<Self::SetupKey, Error>
fn deserialize_setup_key(key: Value) -> Result<Self::SetupKey, Error>
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 extract_additional_key( &self, _key: &KeyValue, _value: &FieldValues, _export_context: &Self::ExportContext, ) -> Result<Value, Error>
fn register(self, registry: &mut ExecutorFactoryRegistry) -> Result<(), Error>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for D1TargetFactory
impl RefUnwindSafe for D1TargetFactory
impl Send for D1TargetFactory
impl Sync for D1TargetFactory
impl Unpin for D1TargetFactory
impl UnsafeUnpin for D1TargetFactory
impl UnwindSafe for D1TargetFactory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> TargetFactory for Twhere
T: TargetFactoryBase,
impl<T> TargetFactory for Twhere
T: TargetFactoryBase,
Source§fn extract_additional_key(
&self,
key: &KeyValue,
value: &FieldValues,
export_context: &(dyn Any + Sync + Send + 'static),
) -> Result<Value, Error>
fn extract_additional_key( &self, key: &KeyValue, value: &FieldValues, export_context: &(dyn Any + Sync + Send + 'static), ) -> Result<Value, Error>
Extract additional keys that are passed through as part of the mutation to apply_mutation().
This is useful for targets that need to use additional parts as key for the target (which is not considered as part of the key for cocoindex).
fn build<'async_trait>(
self: Arc<T>,
data_collections: Vec<ExportDataCollectionSpec>,
declarations: Vec<Value>,
context: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<(Vec<ExportDataCollectionBuildOutput>, Vec<(Value, Value)>), Error>> + Send + 'async_trait>>where
T: 'async_trait,
Source§fn diff_setup_states<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Value,
desired_state: Option<Value>,
existing_states: CombinedState<Value>,
flow_instance_ctx: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ResourceSetupChange>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn diff_setup_states<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 Value,
desired_state: Option<Value>,
existing_states: CombinedState<Value>,
flow_instance_ctx: Arc<FlowInstanceContext>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ResourceSetupChange>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
Will not be called if it’s setup by user.
It returns an error if the target only supports setup by user.
fn describe_resource(&self, key: &Value) -> Result<String, Error>
Source§fn normalize_setup_key(&self, key: &Value) -> Result<Value, Error>
fn normalize_setup_key(&self, key: &Value) -> Result<Value, Error>
Normalize the key. e.g. the JSON format may change (after code change, e.g. new optional field or field ordering), even if the underlying value is not changed.
This should always return the canonical serialized form.