pub struct RepTestBaseBuilder { /* private fields */ }Expand description
Builder for RepTestBase. Use RepTestBase::builder to construct.
Implementations§
Source§impl RepTestBaseBuilder
impl RepTestBaseBuilder
Sourcepub fn group_size(self, n: usize) -> Self
pub fn group_size(self, n: usize) -> Self
Number of nodes in the group (default: 3).
Sourcepub fn base_port(self, p: u16) -> Self
pub fn base_port(self, p: u16) -> Self
Base port; node i will use base_port + i. Default: a process-wide
monotonically allocated port range that does not overlap other
concurrently-running harness groups.
Sourcepub fn node_type(self, t: NodeType) -> Self
pub fn node_type(self, t: NodeType) -> Self
Default node type for every node (default: NodeType::Electable).
Sourcepub fn override_node_type(self, idx: usize, t: NodeType) -> Self
pub fn override_node_type(self, idx: usize, t: NodeType) -> Self
Override the node type for a specific index. May be called multiple times; later calls override earlier ones for the same index.
Sourcepub fn election_timeout(self, t: Duration) -> Self
pub fn election_timeout(self, t: Duration) -> Self
Election timeout passed to RepConfig.
Sourcepub fn quorum_policy(self, q: QuorumPolicy) -> Self
pub fn quorum_policy(self, q: QuorumPolicy) -> Self
Quorum policy passed to RepConfig.
Sourcepub fn name_prefix(self, p: impl Into<String>) -> Self
pub fn name_prefix(self, p: impl Into<String>) -> Self
Per-node name prefix; the i-th node will be named
"{prefix}{i+1}". Default: derived from the group name.
Sourcepub fn build(self) -> RepTestBase
pub fn build(self) -> RepTestBase
Construct the RepTestBase. Does NOT open any envs — call
RepTestBase::create_group to drive the lifecycle.
Auto Trait Implementations§
impl Freeze for RepTestBaseBuilder
impl RefUnwindSafe for RepTestBaseBuilder
impl Send for RepTestBaseBuilder
impl Sync for RepTestBaseBuilder
impl Unpin for RepTestBaseBuilder
impl UnsafeUnpin for RepTestBaseBuilder
impl UnwindSafe for RepTestBaseBuilder
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> 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