pub struct RepConfig {Show 17 fields
pub group_name: String,
pub node_name: String,
pub node_host: String,
pub node_port: u16,
pub node_type: NodeType,
pub election_timeout: Duration,
pub heartbeat_interval: Duration,
pub consistency_policy: ConsistencyPolicy,
pub commit_durability: CommitDurability,
pub env_home: Option<PathBuf>,
pub quorum_policy: QuorumPolicy,
pub phi_threshold: Option<f64>,
pub phi_window_size: usize,
pub initial_peers: Vec<RepNode>,
pub election_phase_timeout: Duration,
pub reconnect_config: ReconnectConfig,
pub transport_kind: RepTransportKind,
}Expand description
Configuration for a replication node.
Use the builder pattern to construct.
Fields§
§group_name: StringName of the replication group.
node_name: StringName of this node within the group (must be unique).
node_host: StringHostname or IP address for this node.
node_port: u16Port for replication communication.
node_type: NodeTypeType of this node.
election_timeout: DurationTimeout for elections.
heartbeat_interval: DurationInterval between heartbeat messages.
consistency_policy: ConsistencyPolicyDefault consistency policy for read operations.
commit_durability: CommitDurabilityDefault commit durability for replicated transactions.
The ack_timeout field on commit_durability governs the
commit-side wait for replica acks; there is no separate
per-RepConfig replica-ack timeout.
env_home: Option<PathBuf>Path to the local environment home directory (.ndb files).
When set, ReplicatedEnvironment registers a NetworkRestoreServer
on the service dispatcher so that other nodes can restore from this
node via the "RESTORE" service.
quorum_policy: QuorumPolicyQuorum policy for elections. Default: SimpleMajority.
phi_threshold: Option<f64>Phi accrual suspicion threshold.
None (default) uses a binary heartbeat timeout.
Some(8.0) enables phi accrual detection with the paper’s recommended
threshold (mistake rate ≈ 10⁻⁸).
phi_window_size: usizeSliding-window size for phi accrual inter-arrival samples.
Default 200 is adequate for LAN; use 1000 for WAN.
initial_peers: Vec<RepNode>Fully-described peers added to the replication group at startup.
Useful for pre-populating quoracle capacity/latency metadata.
election_phase_timeout: DurationTimeout per peer message exchange during Phase 1 and Phase 2 of an election. Default: 500 ms.
reconnect_config: ReconnectConfigReconnection backoff configuration for replica partition recovery.
transport_kind: RepTransportKindWire-level transport this node will use.
This field lets callers declare whether they
intend to drive replication over TCP, TLS, QUIC, or the
in-process crate::net::InMemoryTransport. See
RepTransportKind for the variants. Defaults to
RepTransportKind::Tcp for backward compatibility.
Implementations§
Source§impl RepConfig
impl RepConfig
Sourcepub fn builder(
group_name: &str,
node_name: &str,
node_host: &str,
) -> RepConfigBuilder
pub fn builder( group_name: &str, node_name: &str, node_host: &str, ) -> RepConfigBuilder
Creates a builder for RepConfig.
Sourcepub fn new(
group_name: impl Into<String>,
node_name: impl Into<String>,
node_host: impl Into<String>,
node_port: u16,
) -> RepConfig
pub fn new( group_name: impl Into<String>, node_name: impl Into<String>, node_host: impl Into<String>, node_port: u16, ) -> RepConfig
Convenience constructor matching the original v1.4 shape.
Equivalent to builder(group, node, host).node_port(port).build().
Provided so doc snippets and short tests don’t need to write the
full builder chain.
“RepConfig::new example”).
Sourcepub fn socket_address(&self) -> String
pub fn socket_address(&self) -> String
Returns the socket address string for this node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RepConfig
impl RefUnwindSafe for RepConfig
impl Send for RepConfig
impl Sync for RepConfig
impl Unpin for RepConfig
impl UnsafeUnpin for RepConfig
impl UnwindSafe for RepConfig
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