Struct vdirsyncer::NamedPair
source · pub(crate) struct NamedPair<I: Item> {
pub(crate) name: String,
pub(crate) inner: StoragePair<I>,
pub(crate) status_path: Utf8PathBuf,
pub(crate) conflict_resolution: Option<RawCommand>,
pub(crate) locks: (Arc<Mutex<()>>, Arc<Mutex<()>>),
pub(crate) names: (String, String),
}
Expand description
Pair with a name, as defined in the configuration file.
Fields§
§name: String
§inner: StoragePair<I>
§status_path: Utf8PathBuf
§conflict_resolution: Option<RawCommand>
§locks: (Arc<Mutex<()>>, Arc<Mutex<()>>)
Discretionary locks taken before using a storage. These MUST be sorted based on storage name to prevent possible deadlocks.
names: (String, String)
Implementations§
source§impl<I: Item> NamedPair<I>
impl<I: Item> NamedPair<I>
sourcepub(crate) fn open_status_ro(&self) -> Result<Option<StatusDatabase>>
pub(crate) fn open_status_ro(&self) -> Result<Option<StatusDatabase>>
Returns None
if the database doesn’t exist.
pub(crate) fn open_status_rw(&self) -> Result<StatusDatabase>
sourcepub(crate) async fn daemon(self, interval: Duration) -> Error
pub(crate) async fn daemon(self, interval: Duration) -> Error
Sync this pair indefinitely
Returns an error if an only if a fatal synchronisation error occurred.
pub(crate) async fn sync_once(self, dry_run: bool) -> Result<()>
sourcepub(crate) async fn create_plan(&self) -> Result<Plan<I>>
pub(crate) async fn create_plan(&self) -> Result<Plan<I>>
Returns an error only if it is fatal.
If partial errors occurred during synchronisations, returns Ok(None)
.
pub(crate) async fn execute_plan(&self, plan: Plan<I>) -> Result<()>
pub(crate) async fn discover(&self) -> Result<()>
pub(crate) fn print_plan(&self, plan: &Plan<I>)
pub(crate) async fn resolve_conflicts(self, stdio: Arc<StdIo>) -> Result<()>
Auto Trait Implementations§
impl<I> Freeze for NamedPair<I>
impl<I> !RefUnwindSafe for NamedPair<I>
impl<I> Send for NamedPair<I>
impl<I> Sync for NamedPair<I>
impl<I> Unpin for NamedPair<I>
impl<I> !UnwindSafe for NamedPair<I>
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> 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<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.