[][src]Struct sync15::clients::engine::Engine

pub struct Engine<'a> {
    pub command_processor: &'a dyn CommandProcessor,
    pub interruptee: &'a dyn Interruptee,
    pub recent_clients: HashMap<String, RemoteClient>,
}

Fields

command_processor: &'a dyn CommandProcessorinterruptee: &'a dyn Interrupteerecent_clients: HashMap<String, RemoteClient>

Implementations

impl<'a> Engine<'a>[src]

pub fn new<'b>(
    command_processor: &'b dyn CommandProcessor,
    interruptee: &'b dyn Interruptee
) -> Engine<'b>
[src]

Creates a new clients engine that delegates to the given command processor to apply incoming commands.

pub fn sync(
    &mut self,
    storage_client: &Sync15StorageClient,
    global_state: &GlobalState,
    root_sync_key: &KeyBundle,
    should_refresh_client: bool
) -> Result<()>
[src]

Syncs the clients collection. This works a little differently than other collections:

  1. It can't be disabled or declined.
  2. The sync ID and last sync time aren't meaningful, since we always fetch all client records on every sync. As such, the LocalCollStateMachine that we use for other engines doesn't apply to it.
  3. It doesn't persist state directly, but relies on the sync manager to persist device settings, and process commands.
  4. Failing to sync the clients collection is fatal, and aborts the sync.

For these reasons, we implement this engine directly in the sync15 crate, and provide a specialized sync method instead of implementing sync15::Store.

fn fetch_incoming(
    &self,
    storage_client: &Sync15StorageClient,
    coll_state: &mut CollState
) -> Result<IncomingChangeset>
[src]

pub fn local_client_id(&self) -> String[src]

pub fn get_client_data(&self) -> ClientData[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Engine<'a>

impl<'a> !Send for Engine<'a>

impl<'a> !Sync for Engine<'a>

impl<'a> Unpin for Engine<'a>

impl<'a> !UnwindSafe for Engine<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,