pub struct Cluster { /* private fields */ }Expand description
进程内多节点 Raft 集群。
Implementations§
Source§impl Cluster
impl Cluster
pub fn spawn_with_options(node_ids: &[NodeID], opts: Options) -> Self
pub fn client(&self) -> Client
pub fn transport(&self) -> Transport
pub fn members(&self) -> HashSet<NodeID>
pub fn options(&self) -> &Options
Sourcepub fn set_members(&mut self, members: HashSet<NodeID>)
pub fn set_members(&mut self, members: HashSet<NodeID>)
仅更新本地成员集合视图(协议提交成员变更后由测试调用)。
pub fn partition(&self, a: NodeID, b: NodeID)
pub fn partition_groups(&self, left: &[NodeID], right: &[NodeID])
pub fn heal_all(&self)
pub fn set_drop_rate(&self, rate: f64)
pub fn set_reorder(&self, on: bool)
pub fn is_running(&self, id: NodeID) -> bool
Auto Trait Implementations§
impl Freeze for Cluster
impl RefUnwindSafe for Cluster
impl Send for Cluster
impl Sync for Cluster
impl Unpin for Cluster
impl UnsafeUnpin for Cluster
impl UnwindSafe for Cluster
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