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

Create a provider.

remote is usually a Client, local is usually a Cache. However, both can be interchangeable. The only difference is that remote always wins in case of a sync conflict

Returns the data source described as local

Returns the data source described as local

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.

See Self::sync_with_feedback

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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