This crate was used to support different trait bounds on WASM vs other
targets, since we only define async traits in a couple of places having
a whole crate to support this feels a bit excessive.
This patch defines a target specific super trait instead, this lowers
the compile time a couple of seconds.
This renames our sync methods so it's clearer which one the main one is.
Syncing should be done with the sync method, if one wishes to sync only
once the sync_method is provided.
If one wishes to have a callback called with every sync the
sync_with_callback method exists, the callback now returns a boolean
that signals if the loop should be aborted. This does not mean that the
current sync request will abort, a cancelable future is still needed for
this.
The client objects in the sdk accepted an optional session argument at
creation time. If provided this would restore the client into a logged
in state.
Since we need to restore the client state and encryption state at some
point it makes sense to do it when the client transitions into a logged
in state. At the same time we would like to avoid the client creation to
be async.
This introduces a restore_login() method which can be called instead of
the login() method to restore a session.