pub struct SyncSettings {
pub replicas: ReplicationFactor,
pub seeds: BTreeSet<NodeId>,
pub timeout: Duration,
}Expand description
Repository sync settings.
Fields§
§replicas: ReplicationFactorSync with at least N replicas.
seeds: BTreeSet<NodeId>Sync with the given list of seeds.
timeout: DurationHow long to wait for syncing to complete.
Implementations§
Source§impl SyncSettings
impl SyncSettings
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Set sync timeout. Defaults to DEFAULT_SYNC_TIMEOUT.
Sourcepub fn replicas(self, replicas: ReplicationFactor) -> Self
pub fn replicas(self, replicas: ReplicationFactor) -> Self
Set replicas.
Sourcepub fn seeds(self, seeds: impl IntoIterator<Item = NodeId>) -> Self
pub fn seeds(self, seeds: impl IntoIterator<Item = NodeId>) -> Self
Set seeds.
Sourcepub fn with_profile(self, profile: &Profile) -> Self
pub fn with_profile(self, profile: &Profile) -> Self
Use profile to populate sync settings, by adding preferred seeds if no seeds are specified, and removing the local node from the set.
Trait Implementations§
Source§impl Clone for SyncSettings
impl Clone for SyncSettings
Source§fn clone(&self) -> SyncSettings
fn clone(&self) -> SyncSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyncSettings
impl Debug for SyncSettings
Source§impl Default for SyncSettings
impl Default for SyncSettings
Source§impl PartialEq for SyncSettings
impl PartialEq for SyncSettings
impl Eq for SyncSettings
impl StructuralPartialEq for SyncSettings
Auto Trait Implementations§
impl Freeze for SyncSettings
impl RefUnwindSafe for SyncSettings
impl Send for SyncSettings
impl Sync for SyncSettings
impl Unpin for SyncSettings
impl UnwindSafe for SyncSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more