pub trait Backend {
type Config: for<'a> Facet<'a> + Sync;
type Error: StdError + Send + Sync + 'static;
type Live: Send;
type Operation: Display + Send + Sync;
// Required methods
fn apply(
&self,
repository: &RepoRef,
operation: &Self::Operation,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn plan(
config: &Self::Config,
live: &Self::Live,
) -> Planned<Self::Operation>;
fn read(
&self,
repository: &RepoRef,
config: &Self::Config,
) -> impl Future<Output = Result<Self::Live, Self::Error>> + Send;
fn validate(config: &Self::Config) -> Result<(), Self::Error>;
}Expand description
An adapter that reads one forge and applies planned writes to it.
The adapter owns the shape of the desired state, the live state and the writes. The shared code only orders and reports them.
Required Associated Types§
Required Methods§
Sourcefn apply(
&self,
repository: &RepoRef,
operation: &Self::Operation,
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn apply( &self, repository: &RepoRef, operation: &Self::Operation, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Perform one planned operation.
Sourcefn plan(config: &Self::Config, live: &Self::Live) -> Planned<Self::Operation>
fn plan(config: &Self::Config, live: &Self::Live) -> Planned<Self::Operation>
Compare the desired and the live state without any I/O.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".