[][src]Struct sync15::SetupStateMachine

pub struct SetupStateMachine<'a> {
    client: &'a dyn SetupStorageClient,
    root_key: &'a KeyBundle,
    pgs: &'a mut PersistedGlobalState,
    allowed_states: Vec<&'static str>,
    sequence: Vec<&'static str>,
    engine_updates: Option<&'a HashMap<String, bool>>,
    interruptee: &'a dyn Interruptee,
    pub(crate) changes_needed: Option<EngineChangesNeeded>,
}

Fields

client: &'a dyn SetupStorageClientroot_key: &'a KeyBundlepgs: &'a mut PersistedGlobalStateallowed_states: Vec<&'static str>sequence: Vec<&'static str>engine_updates: Option<&'a HashMap<String, bool>>interruptee: &'a dyn Interrupteechanges_needed: Option<EngineChangesNeeded>

Implementations

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

pub fn for_full_sync(
    client: &'a dyn SetupStorageClient,
    root_key: &'a KeyBundle,
    pgs: &'a mut PersistedGlobalState,
    engine_updates: Option<&'a HashMap<String, bool>>,
    interruptee: &'a dyn Interruptee
) -> SetupStateMachine<'a>
[src]

Creates a state machine for a "classic" Sync 1.5 client that supports all states, including uploading a fresh meta/global and crypto/keys after a node reassignment.

pub fn for_fast_sync(
    client: &'a dyn SetupStorageClient,
    root_key: &'a KeyBundle,
    pgs: &'a mut PersistedGlobalState,
    engine_updates: Option<&'a HashMap<String, bool>>,
    interruptee: &'a dyn Interruptee
) -> SetupStateMachine<'a>
[src]

Creates a state machine for a fast sync, which only uses locally cached global state, and bails if meta/global or crypto/keys are missing or out-of-date. This is useful in cases where it's important to get to ready as quickly as possible, like syncing before sleep, or when conserving time or battery life.

pub fn for_readonly_sync(
    client: &'a dyn SetupStorageClient,
    root_key: &'a KeyBundle,
    pgs: &'a mut PersistedGlobalState,
    interruptee: &'a dyn Interruptee
) -> SetupStateMachine<'a>
[src]

Creates a state machine for a read-only sync, where the client can't upload meta/global or crypto/keys. Useful for clients that only sync specific collections, like Lockbox.

fn with_allowed_states(
    client: &'a dyn SetupStorageClient,
    root_key: &'a KeyBundle,
    pgs: &'a mut PersistedGlobalState,
    interruptee: &'a dyn Interruptee,
    engine_updates: Option<&'a HashMap<String, bool>>,
    allowed_states: Vec<&'static str>
) -> SetupStateMachine<'a>
[src]

fn advance(&mut self, from: SetupState) -> Result<SetupState>[src]

pub fn run_to_ready(
    &mut self,
    state: Option<GlobalState>
) -> Result<GlobalState>
[src]

Runs through the state machine to the ready state.

Auto Trait Implementations

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

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

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

impl<'a> Unpin for SetupStateMachine<'a>

impl<'a> !UnwindSafe for SetupStateMachine<'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>,