Skip to main content

RepConfigBuilder

Struct RepConfigBuilder 

Source
pub struct RepConfigBuilder { /* private fields */ }
Expand description

Builder for RepConfig.

Implementations§

Source§

impl RepConfigBuilder

Source

pub fn node_port(self, port: u16) -> Self

Sets the replication port.

Source

pub fn node_type(self, node_type: NodeType) -> Self

Sets the node type.

Source

pub fn election_timeout(self, timeout: Duration) -> Self

Sets the election timeout.

Source

pub fn heartbeat_interval(self, interval: Duration) -> Self

Sets the heartbeat interval.

Source

pub fn consistency_policy(self, policy: ConsistencyPolicy) -> Self

Sets the consistency policy.

Source

pub fn commit_durability(self, durability: CommitDurability) -> Self

Sets the commit durability.

Source

pub fn env_home(self, path: impl Into<PathBuf>) -> Self

Sets the environment home directory (serves .ndb files for network restore).

Source

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.

Source

pub fn quorum_policy(self, policy: QuorumPolicy) -> Self

Sets the quorum policy for elections (default: SimpleMajority).

Source

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.

Source

pub fn phi_window_size(self, size: usize) -> Self

Sets the phi accrual inter-arrival sample window size (default 200).

Source

pub fn add_initial_peer(self, node: RepNode) -> Self

Add a fully-described initial peer to the group at startup.

Source

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).

Source

pub fn reconnect_config(self, config: ReconnectConfig) -> Self

Sets the reconnection backoff configuration for replica partition recovery.

Source

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.

Source

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.

Source

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.

Source

pub fn build(self) -> RepConfig

Builds the RepConfig.

Trait Implementations§

Source§

impl Clone for RepConfigBuilder

Source§

fn clone(&self) -> RepConfigBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepConfigBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

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

Source§

fn vzip(self) -> V