pub struct TopicState {
pub config: TopicConfig,
pub partitions: Vec<PartitionState>,
}Expand description
Topic state including all partitions
Fields§
§config: TopicConfigTopic configuration
partitions: Vec<PartitionState>Partition states
Implementations§
Source§impl TopicState
impl TopicState
pub fn new(config: TopicConfig, partition_assignments: Vec<Vec<NodeId>>) -> Self
Sourcepub fn partition(&self, idx: u32) -> Option<&PartitionState>
pub fn partition(&self, idx: u32) -> Option<&PartitionState>
Get partition by index
Sourcepub fn partition_mut(&mut self, idx: u32) -> Option<&mut PartitionState>
pub fn partition_mut(&mut self, idx: u32) -> Option<&mut PartitionState>
Get mutable partition by index
Sourcepub fn is_fully_online(&self) -> bool
pub fn is_fully_online(&self) -> bool
Check if all partitions have a leader
Sourcepub fn is_under_replicated(&self) -> bool
pub fn is_under_replicated(&self) -> bool
Check if any partition is under-replicated
Sourcepub fn offline_partitions(&self) -> Vec<u32>
pub fn offline_partitions(&self) -> Vec<u32>
Get offline partitions
Trait Implementations§
Source§impl Clone for TopicState
impl Clone for TopicState
Source§fn clone(&self) -> TopicState
fn clone(&self) -> TopicState
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 TopicState
impl Debug for TopicState
Source§impl<'de> Deserialize<'de> for TopicState
impl<'de> Deserialize<'de> for TopicState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TopicState
impl RefUnwindSafe for TopicState
impl Send for TopicState
impl Sync for TopicState
impl Unpin for TopicState
impl UnsafeUnpin for TopicState
impl UnwindSafe for TopicState
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