Struct kitchen_fridge::provider::Provider [−][src]
pub struct Provider<L, T, R, U> where
L: CalDavSource<T>,
T: CompleteCalendar + Sync + Send,
R: CalDavSource<U>,
U: DavCalendar + Sync + Send, { /* fields omitted */ }Expand description
A data source that combines two CalDavSources, which is able to sync both sources.
Usually, you will only need to use a provider between a server and a local cache, that is to say a CalDavProvider, i.e. a Provider<Cache, CachedCalendar, Client, RemoteCalendar>.
However, providers can be used for integration tests, where the remote source is mocked by a Cache.
Implementations
impl<L, T, R, U> Provider<L, T, R, U> where
L: CalDavSource<T>,
T: CompleteCalendar + Sync + Send,
R: CalDavSource<U>,
U: DavCalendar + Sync + Send,
impl<L, T, R, U> Provider<L, T, R, U> where
L: CalDavSource<T>,
T: CompleteCalendar + Sync + Send,
R: CalDavSource<U>,
U: DavCalendar + Sync + Send,
Returns the data source described as remote.
Apart from tests, there are very few (if any) reasons to access remote directly.
Usually, you should rather use the local source, which (usually) is a much faster local cache.
To be sure local accurately mirrors the remote source, you can run Provider::sync
Performs a synchronisation between local and remote, and provide feeedback to the user about the progress.
This bidirectional sync applies additions/deletions made on a source to the other source.
In case of conflicts (the same item has been modified on both ends since the last sync, remote always wins).
It returns whether the sync was totally successful (details about errors are logged using the log::* macros).
In case errors happened, the sync might have been partially executed but your data will never be correupted (either locally nor in the server).
Simply run this function again, it will re-start a sync, picking up where it failed.
Performs a synchronisation between local and remote, without giving any feedback.
Trait Implementations
impl<L: Debug, T: Debug, R: Debug, U: Debug> Debug for Provider<L, T, R, U> where
L: CalDavSource<T>,
T: CompleteCalendar + Sync + Send,
R: CalDavSource<U>,
U: DavCalendar + Sync + Send,
impl<L: Debug, T: Debug, R: Debug, U: Debug> Debug for Provider<L, T, R, U> where
L: CalDavSource<T>,
T: CompleteCalendar + Sync + Send,
R: CalDavSource<U>,
U: DavCalendar + Sync + Send,
Auto Trait Implementations
impl<L, T, R, U> RefUnwindSafe for Provider<L, T, R, U> where
L: RefUnwindSafe,
R: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<L, T, R, U> UnwindSafe for Provider<L, T, R, U> where
L: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more