pub struct TopicDescription { /* private fields */ }Expand description
A detailed description of a single topic in the cluster.
Corresponds to org.apache.kafka.clients.admin.TopicDescription.
authorized_operations uses BTreeSet for a deterministic ordering; Java
uses an unordered Set<AclOperation>. It is Option because Java’s field is
nullable: KafkaAdminClient fills it from AdminUtils.validAclOperations,
which returns null when the broker did not report the operations — distinct
from a broker reporting an empty set.
Equality mirrors Java’s TopicDescription.equals, which compares name,
internal, partitions and authorized_operations but not topic_id
— see the manual PartialEq impl below.
Implementations§
Source§impl TopicDescription
impl TopicDescription
Sourcepub fn new(
name: impl Into<String>,
internal: bool,
partitions: Vec<TopicPartitionInfo>,
) -> Self
pub fn new( name: impl Into<String>, internal: bool, partitions: Vec<TopicPartitionInfo>, ) -> Self
Create an instance with name, internal flag and partitions (empty authorized operations, zero topic id).
Mirrors TopicDescription(String, boolean, List<TopicPartitionInfo>),
which passes Collections.emptySet() — a reported-but-empty set, i.e.
Some(empty) rather than None.
Create an instance with the specified parameters (zero topic id).
name- the topic nameinternal- whether the topic is internal to Kafkapartitions- a list of partitions where the index represents the partition id and the element contains leadership and replica information for that partitionauthorized_operations- authorized operations for this topic, orNoneif this is not known (Java’s nullableSet<AclOperation>)
Mirrors TopicDescription(String, boolean, List<TopicPartitionInfo>, Set<AclOperation>), which passes Uuid.ZERO_UUID.
Create an instance with the specified parameters.
name- the topic nameinternal- whether the topic is internal to Kafkapartitions- a list of partitions where the index represents the partition id and the element contains leadership and replica information for that partitionauthorized_operations- authorized operations for this topic, orNoneif this is not known (Java’s nullableSet<AclOperation>)topic_id- the topic id
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Whether the topic is internal to Kafka. An example of an internal topic
is the offsets and group management topic: __consumer_offsets.
Sourcepub fn partitions(&self) -> &[TopicPartitionInfo]
pub fn partitions(&self) -> &[TopicPartitionInfo]
A list of partitions where the index represents the partition id and the element contains leadership and replica information for that partition.
Authorized operations for this topic, or None if the broker did not
report them (Java returns null in that case). Some holding an empty
set means the broker reported that no operation is authorized.
Trait Implementations§
Source§impl Clone for TopicDescription
impl Clone for TopicDescription
Source§fn clone(&self) -> TopicDescription
fn clone(&self) -> TopicDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TopicDescription
impl Debug for TopicDescription
Source§impl Display for TopicDescription
impl Display for TopicDescription
Source§impl PartialEq for TopicDescription
impl PartialEq for TopicDescription
impl Eq for TopicDescription
Auto Trait Implementations§
impl Freeze for TopicDescription
impl RefUnwindSafe for TopicDescription
impl Send for TopicDescription
impl Sync for TopicDescription
impl Unpin for TopicDescription
impl UnsafeUnpin for TopicDescription
impl UnwindSafe for TopicDescription
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,
§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
§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
key and return true if they are equal.