[−][src]Struct rdkafka::topic_partition_list::TopicPartitionList
A structure to store and manipulate a list of topics and partitions with optional offsets.
Methods
impl TopicPartitionList
[src]
pub fn new() -> TopicPartitionList
[src]
Creates a new empty list with default capacity.
pub fn with_capacity(capacity: usize) -> TopicPartitionList
[src]
Creates a new empty list with the specified capacity.
pub fn from_topic_map(
topic_map: &HashMap<(String, i32), Offset>
) -> TopicPartitionList
[src]
topic_map: &HashMap<(String, i32), Offset>
) -> TopicPartitionList
Given a topic map, generates a new TopicPartitionList
.
pub fn ptr(&self) -> *mut RDKafkaTopicPartitionList
[src]
Returns the pointer to the internal librdkafka structure.
pub fn count(&self) -> usize
[src]
Returns the number of elements in the list.
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the list.
pub fn add_topic_unassigned<'a>(
&'a mut self,
topic: &str
) -> TopicPartitionListElem<'a>
[src]
&'a mut self,
topic: &str
) -> TopicPartitionListElem<'a>
Adds a topic with unassigned partitions to the list.
pub fn add_partition<'a>(
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
[src]
&'a mut self,
topic: &str,
partition: i32
) -> TopicPartitionListElem<'a>
Adds a topic and partition to the list.
pub fn add_partition_range(
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
[src]
&mut self,
topic: &str,
start_partition: i32,
stop_partition: i32
)
Adds a topic and partition range to the list.
pub fn set_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
[src]
&mut self,
topic: &str,
partition: i32,
offset: Offset
) -> KafkaResult<()>
Sets the offset for an already created topic partition. It will fail if the topic partition isn't in the list.
pub fn add_partition_offset(
&mut self,
topic: &str,
partition: i32,
offset: Offset
)
[src]
&mut self,
topic: &str,
partition: i32,
offset: Offset
)
Adds a topic and partition to the list, with the specified offset.
pub fn find_partition(
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem>
[src]
&self,
topic: &str,
partition: i32
) -> Option<TopicPartitionListElem>
Given a topic name and a partition number, returns the corresponding list element.
pub fn set_all_offsets(&mut self, offset: Offset)
[src]
Sets all partitions in the list to the specified offset.
pub fn elements(&self) -> Vec<TopicPartitionListElem>
[src]
Returns all the elements of the list.
pub fn elements_for_topic<'a>(
&'a self,
topic: &str
) -> Vec<TopicPartitionListElem<'a>>
[src]
&'a self,
topic: &str
) -> Vec<TopicPartitionListElem<'a>>
Returns all the elements of the list that belong to the specified topic.
pub fn to_topic_map(&self) -> HashMap<(String, i32), Offset>
[src]
Returns a hashmap-based representation of the list.
Trait Implementations
impl Clone for TopicPartitionList
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TopicPartitionList
[src]
impl Default for TopicPartitionList
[src]
impl Drop for TopicPartitionList
[src]
impl PartialEq<TopicPartitionList> for TopicPartitionList
[src]
Auto Trait Implementations
impl RefUnwindSafe for TopicPartitionList
impl !Send for TopicPartitionList
impl !Sync for TopicPartitionList
impl Unpin for TopicPartitionList
impl UnwindSafe for TopicPartitionList
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,