pub struct PartitionInfo { /* private fields */ }Expand description
This is used to describe per-partition state in the MetadataResponse.
Implementations§
Source§impl PartitionInfo
impl PartitionInfo
Sourcepub fn new(
topic: String,
partition: i32,
leader: Option<Node>,
replicas: Vec<Node>,
in_sync_replicas: Vec<Node>,
) -> Self
pub fn new( topic: String, partition: i32, leader: Option<Node>, replicas: Vec<Node>, in_sync_replicas: Vec<Node>, ) -> Self
Creates a new PartitionInfo with no offline replicas.
Sourcepub fn with_offline_replicas(
topic: String,
partition: i32,
leader: Option<Node>,
replicas: Vec<Node>,
in_sync_replicas: Vec<Node>,
offline_replicas: Vec<Node>,
) -> Self
pub fn with_offline_replicas( topic: String, partition: i32, leader: Option<Node>, replicas: Vec<Node>, in_sync_replicas: Vec<Node>, offline_replicas: Vec<Node>, ) -> Self
Creates a new PartitionInfo with offline replicas.
Sourcepub fn leader(&self) -> Option<&Node>
pub fn leader(&self) -> Option<&Node>
The node currently acting as a leader for this partition, or None if there is no leader.
Sourcepub fn replicas(&self) -> &[Node]
pub fn replicas(&self) -> &[Node]
The complete set of replicas for this partition regardless of whether they are alive or up-to-date. The preferred replica is the head of the list.
Sourcepub fn in_sync_replicas(&self) -> &[Node]
pub fn in_sync_replicas(&self) -> &[Node]
The subset of the replicas that are in sync, that is caught-up to the leader and ready to take over as leader if the leader should fail.
Sourcepub fn offline_replicas(&self) -> &[Node]
pub fn offline_replicas(&self) -> &[Node]
The subset of the replicas that are offline.
Trait Implementations§
Source§impl Clone for PartitionInfo
impl Clone for PartitionInfo
Source§fn clone(&self) -> PartitionInfo
fn clone(&self) -> PartitionInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PartitionInfo
impl Debug for PartitionInfo
Source§impl Display for PartitionInfo
impl Display for PartitionInfo
Source§impl Hash for PartitionInfo
impl Hash for PartitionInfo
Source§impl PartialEq for PartitionInfo
impl PartialEq for PartitionInfo
impl Eq for PartitionInfo
Auto Trait Implementations§
impl Freeze for PartitionInfo
impl RefUnwindSafe for PartitionInfo
impl Send for PartitionInfo
impl Sync for PartitionInfo
impl Unpin for PartitionInfo
impl UnsafeUnpin for PartitionInfo
impl UnwindSafe for PartitionInfo
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more