pub struct RepConfigBuilder { /* private fields */ }Expand description
Builder for RepConfig.
Implementations§
Source§impl RepConfigBuilder
impl RepConfigBuilder
Sourcepub fn election_timeout(self, timeout: Duration) -> Self
pub fn election_timeout(self, timeout: Duration) -> Self
Sets the election timeout.
Sourcepub fn heartbeat_interval(self, interval: Duration) -> Self
pub fn heartbeat_interval(self, interval: Duration) -> Self
Sets the heartbeat interval.
Sourcepub fn consistency_policy(self, policy: ConsistencyPolicy) -> Self
pub fn consistency_policy(self, policy: ConsistencyPolicy) -> Self
Sets the consistency policy.
Sourcepub fn commit_durability(self, durability: CommitDurability) -> Self
pub fn commit_durability(self, durability: CommitDurability) -> Self
Sets the commit durability.
Sourcepub fn env_home(self, path: impl Into<PathBuf>) -> Self
pub fn env_home(self, path: impl Into<PathBuf>) -> Self
Sets the environment home directory (serves .ndb files for network restore).
Sourcepub fn cascade_feeding(self, enabled: bool) -> Self
pub fn cascade_feeding(self, enabled: bool) -> Self
Enable chained / replica-to-replica log feeding (default false).
When true, a node that becomes a replica also runs a feeder source
on its PEER_FEEDER service, serving its OWN WAL to a downstream
replica (master → R1 → R2). See RepConfig::cascade_feeding for
the JE FeederSource citation and the durability bound.
Sourcepub fn quorum_policy(self, policy: QuorumPolicy) -> Self
pub fn quorum_policy(self, policy: QuorumPolicy) -> Self
Sets the quorum policy for elections (default: SimpleMajority).
Sourcepub fn phi_threshold(self, threshold: Option<f64>) -> Self
pub fn phi_threshold(self, threshold: Option<f64>) -> Self
Enable phi accrual failure detection with the given suspicion threshold.
8.0 is the paper’s recommended production value (mistake rate ≈ 10⁻⁸).
Call with None to revert to binary heartbeat timeout detection.
Sourcepub fn phi_window_size(self, size: usize) -> Self
pub fn phi_window_size(self, size: usize) -> Self
Sets the phi accrual inter-arrival sample window size (default 200).
Sourcepub fn add_initial_peer(self, node: RepNode) -> Self
pub fn add_initial_peer(self, node: RepNode) -> Self
Add a fully-described initial peer to the group at startup.
Sourcepub fn election_phase_timeout(self, timeout: Duration) -> Self
pub fn election_phase_timeout(self, timeout: Duration) -> Self
Set the per-peer message timeout for Phase 1 and Phase 2 election exchanges (default: 500 ms).
Sourcepub fn reconnect_config(self, config: ReconnectConfig) -> Self
pub fn reconnect_config(self, config: ReconnectConfig) -> Self
Sets the reconnection backoff configuration for replica partition recovery.
Sourcepub fn transport_kind(self, kind: RepTransportKind) -> Self
pub fn transport_kind(self, kind: RepTransportKind) -> Self
Sets the wire-level transport this node will use.
Defaults to RepTransportKind::Tcp.
RepTransportKind::InMemory for in-process clusters.
Sourcepub fn peer_allowlist(self, names: Vec<String>) -> Self
pub fn peer_allowlist(self, names: Vec<String>) -> Self
Set the mTLS peer allowlist (Phase 2, v3.1.0).
When non-empty and transport_kind is RepTransportKind::Tls,
incoming TLS connections must present a certificate whose Subject CN
or DNS SAN matches at least one entry here (case-insensitive, exact
match). Connections that fail the check are rejected at the TLS
handshake layer.
See RepConfig::peer_allowlist for full details.
Sourcepub fn tls_config(self, tls: TlsConfig) -> Self
pub fn tls_config(self, tls: TlsConfig) -> Self
Set the TLS configuration for the service dispatcher (Phase 3).
When set and transport_kind is RepTransportKind::Tls,
crate::replicated_environment::ReplicatedEnvironment will use a
TLS-capable service dispatcher that enforces mTLS when
peer_allowlist is also non-empty.
See RepConfig::tls_config for full details.
Trait Implementations§
Source§impl Clone for RepConfigBuilder
impl Clone for RepConfigBuilder
Source§fn clone(&self) -> RepConfigBuilder
fn clone(&self) -> RepConfigBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RepConfigBuilder
impl RefUnwindSafe for RepConfigBuilder
impl Send for RepConfigBuilder
impl Sync for RepConfigBuilder
impl Unpin for RepConfigBuilder
impl UnsafeUnpin for RepConfigBuilder
impl UnwindSafe for RepConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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