pub struct SyncEngine { /* private fields */ }Expand description
Sync engine for pulling sessions from remote sources.
Implementations§
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn new(data_dir: &Path) -> Self
pub fn new(data_dir: &Path) -> Self
Create a new sync engine.
§Arguments
data_dir- The cass data directory (e.g., ~/.local/share/coding-agent-search)
Sourcepub fn with_connection_timeout(self, seconds: u64) -> Self
pub fn with_connection_timeout(self, seconds: u64) -> Self
Set the connection timeout.
Sourcepub fn with_transfer_timeout(self, seconds: u64) -> Self
pub fn with_transfer_timeout(self, seconds: u64) -> Self
Set the transfer timeout.
Sourcepub fn mirror_dir(&self, source_name: &str) -> PathBuf
pub fn mirror_dir(&self, source_name: &str) -> PathBuf
Get the local mirror directory for a source.
Sourcepub fn detect_sync_method() -> SyncMethod
pub fn detect_sync_method() -> SyncMethod
Detect the available sync method.
Detection order:
- Native
rsync→SyncMethod::Rsync wsl rsync(Windows only) →SyncMethod::WslRsync- System
scpavailable →SyncMethod::Scp - Last resort →
SyncMethod::Sftp(ssh2-based, no native-agent integration)
On Windows the ssh2 SFTP path is intentionally avoided whenever possible
because it bypasses the Windows OpenSSH agent and ~/.ssh/config, leading to
“No valid authentication method found” errors even when SSH keys are properly
configured. Using the system scp binary instead lets OpenSSH handle auth the
same way ssh and cass sources doctor do.
Sourcepub fn sync_source(
&self,
source: &SourceDefinition,
) -> Result<SyncReport, SyncError>
pub fn sync_source( &self, source: &SourceDefinition, ) -> Result<SyncReport, SyncError>
Sync a single source.
Syncs all configured paths from the source to the local mirror directory. Individual path failures don’t abort the entire sync.
Sourcepub fn sync_all(
&self,
sources: impl Iterator<Item = impl Borrow<SourceDefinition>>,
) -> Vec<SyncReport>
pub fn sync_all( &self, sources: impl Iterator<Item = impl Borrow<SourceDefinition>>, ) -> Vec<SyncReport>
Sync all remote sources from a config.
Continues even if individual sources fail.
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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>
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>
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 more