Skip to main content

SyncEngineBuilder

Struct SyncEngineBuilder 

Source
pub struct SyncEngineBuilder<M: RecordMapper> { /* private fields */ }

Implementations§

Source§

impl<M: RecordMapper + 'static> SyncEngineBuilder<M>

Source

pub fn new( mapper: Arc<M>, backend: Arc<dyn Backend>, local: Arc<dyn LocalStore<M::Item>>, storage: Box<dyn LedgerStorage>, ) -> Self
where M::Item: 'static,

Source

pub fn local_page_size(self, n: usize) -> Self

Items requested per LocalStore::list_page call during a pass (default 1000, minimum 1).

Source

pub fn max_uploads_per_pass(self, n: usize) -> Self

Most items one pass keeps in memory to upload (default 0 = no limit). The pass keeps the n that sort first by (origin time, record name), the order uploads already use, and leaves the rest for a later pass: they are not marked as published, so the next scan finds them again. When any were left, the pass reports the event uploads_deferred with their count, so the host can run another pass at once. Without a limit a first sync of a large store holds every item to publish at the same time.

Source

pub fn auth(self, v: Arc<dyn AuthProvider>) -> Self

Source

pub fn policy(self, v: Box<dyn ConflictPolicy<M::Item>>) -> Self

Source

pub fn clock(self, v: Arc<dyn Clock>) -> Self

Source

pub fn observer(self, v: Arc<dyn SyncObserver>) -> Self

Source

pub fn hooks(self, v: Arc<dyn PassHooks>) -> Self

Source

pub fn config(self, v: SyncConfig) -> Self

Source

pub fn build(self) -> SyncResult<SyncEngine<M>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.