pub struct Backend { /* private fields */ }

Implementations

source

pub fn get_entry<T: Into<ID>>(&self, id: T) -> Fallible<Option<Entry>>

Get a Vec of tags from the db.

Get a Vec of tags from the db.

Get a Vec of entries from the db.

Add a new url and attempts to upload and create entry immediatedly. Fails if network connection down.

Add a new url. Does not attempt to upload immediately.

Full sync. Can be slow if many articles. This will sync everything, including things that can’t be synced with a quick/normal sync (eg. server-side deleted items)

For entries and annotations existing in the database, object with latest updated_at value wins.

Tags are tied to Entries, even though the tags will also have seperate db tables dedicated to them. An updated tag should mean an updated updated_at field in an entry.

NOTE: changing tags on an entry touches updated_at. To add a tag locally, create a new tag object with an arbitrary slug and id, add it to the Entry object, and save to db. taglinks and tags table will be updated in next sync.

NOTE: changing an annotation does not update entry updated_at

Normal sync. Syncs everything changed since the last sync, with the exception of deleted entries and annotations (syncing deletes requires a full sweep through everything).

For entries and annotations existing in the database, object with latest updated_at value wins.

What this does not sync:

  • Entries deleted server-side.
  • Annotations deleted server-side.
  • Annotations updated or created server-side that are not associated with entries updated since previous sync. (ie. recently updated annotations on non-recently updated entries)

TODO: ignore errors relating to actions that have already been done - eg. 404 error on client delete entry.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.