pub struct SyncEngine {
pub config: SyncConfig,
pub backend: Box<dyn GitBackend>,
pub providers: Vec<Box<dyn AuthProvider>>,
}Expand description
The sync engine coordinates pulling credentials from a Git repo to local filesystem and pushing local credentials to the repo.
Fields§
§config: SyncConfig§backend: Box<dyn GitBackend>§providers: Vec<Box<dyn AuthProvider>>Implementations§
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn new(config: SyncConfig) -> Result<Self, SyncError>
pub fn new(config: SyncConfig) -> Result<Self, SyncError>
Create a new SyncEngine with the given config and default Git backend.
Sourcepub fn with_backend(
config: SyncConfig,
backend: Box<dyn GitBackend>,
) -> Result<Self, SyncError>
pub fn with_backend( config: SyncConfig, backend: Box<dyn GitBackend>, ) -> Result<Self, SyncError>
Create a SyncEngine with a custom backend (for testing or alternative storage).
Sourcepub async fn ensure_repo(&self) -> Result<(), SyncError>
pub async fn ensure_repo(&self) -> Result<(), SyncError>
Ensure the sync repo is cloned locally; clone if not.
Sourcepub async fn pull(&self) -> Result<SyncReport, SyncError>
pub async fn pull(&self) -> Result<SyncReport, SyncError>
Pull credentials from the remote repo to local filesystem.
- Ensure repo is cloned
- Git pull
- Copy files from repo → local credential paths
Sourcepub async fn push(&self) -> Result<SyncReport, SyncError>
pub async fn push(&self) -> Result<SyncReport, SyncError>
Push local credentials to the remote repo.
- Ensure repo is cloned
- Git pull (to avoid conflicts)
- Copy local credential files → repo
- Git commit + push
Auto Trait Implementations§
impl Freeze for SyncEngine
impl !RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnsafeUnpin for SyncEngine
impl !UnwindSafe for SyncEngine
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