pub struct App {
pub cluster: String,
pub config: InternalConfig,
pub search_query: ValidSearchQuery,
}Expand description
Struct exposing different functions for consuming kafka records.
Fields§
§cluster: String§config: InternalConfig§search_query: ValidSearchQueryImplementations§
Source§impl App
impl App
pub fn new( cluster: String, config: InternalConfig, search_query: ValidSearchQuery, ) -> Self
pub fn schema_registry(&self) -> Option<SchemaRegistryClient>
Sourcepub fn create_consumer(
&self,
topics: &Vec<String>,
) -> Result<StreamConsumer, Error>
pub fn create_consumer( &self, topics: &Vec<String>, ) -> Result<StreamConsumer, Error>
Create a kafka consumer
pub fn consumer_config(&self) -> ConsumerConfig
Sourcepub fn export_record(&self, record: &KafkaRecord) -> Result<(), Error>
pub fn export_record(&self, record: &KafkaRecord) -> Result<(), Error>
Exports a given kafka record to a file. The Name of the file is automatically generated at the runtime
Sourcepub fn estimate_number_of_records_to_read(
&self,
topic_partition_list: &TopicPartitionList,
) -> Result<i64, Error>
pub fn estimate_number_of_records_to_read( &self, topic_partition_list: &TopicPartitionList, ) -> Result<i64, Error>
Calculates an estimate of the number of records that are going to be read. This function is used to render a progress bar.
Sourcepub fn topic_details(
&self,
topics: HashSet<String>,
) -> Result<Vec<TopicDetail>, Error>
pub fn topic_details( &self, topics: HashSet<String>, ) -> Result<Vec<TopicDetail>, Error>
Returns the topics details for a given list topics This function is not ready yet
pub async fn topic_config_of( &self, topic: &str, ) -> Result<Option<TopicConfig>, Error>
pub fn count_records_in_topic(&self, topic: &str) -> Result<i64, Error>
Sourcepub fn list_topics(&self) -> Result<Vec<String>, Error>
pub fn list_topics(&self) -> Result<Vec<String>, Error>
Lists available kafka topics on the cluster.
Sourcepub fn list_topics_from_client(
yozefu_config: &YozefuConfig,
) -> Result<Vec<String>, Error>
pub fn list_topics_from_client( yozefu_config: &YozefuConfig, ) -> Result<Vec<String>, Error>
Lists available topics on the cluster with a custom kafka client.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnwindSafe for App
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,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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