Struct rdkafka::client::Client [−][src]
A low-level rdkafka client.
This type is the basis of the consumers and producers in the consumer
and producer
modules, respectively.
Typically you do not want to construct a Client
directly, but instead
construct a consumer or producer. A Client
can be used, however, when
only access to cluster metadata and watermarks is required.
Implementations
impl<C: ClientContext> Client<C>
[src]
pub fn new(
config: &ClientConfig,
native_config: NativeClientConfig,
rd_kafka_type: RDKafkaType,
context: C
) -> KafkaResult<Client<C>>
[src]
config: &ClientConfig,
native_config: NativeClientConfig,
rd_kafka_type: RDKafkaType,
context: C
) -> KafkaResult<Client<C>>
Creates a new Client
given a configuration, a client type and a context.
pub fn native_client(&self) -> &NativeClient
[src]
Returns a reference to the native rdkafka-sys client.
pub fn native_ptr(&self) -> *mut RDKafka
[src]
Returns a pointer to the native rdkafka-sys client.
pub fn context(&self) -> &Arc<C>
[src]
Returns a reference to the context.
pub fn fetch_metadata<T: Into<Timeout>>(
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata>
[src]
&self,
topic: Option<&str>,
timeout: T
) -> KafkaResult<Metadata>
Returns the metadata information for the specified topic, or for all topics in the cluster if no topic is specified.
pub fn fetch_watermarks<T: Into<Timeout>>(
&self,
topic: &str,
partition: i32,
timeout: T
) -> KafkaResult<(i64, i64)>
[src]
&self,
topic: &str,
partition: i32,
timeout: T
) -> KafkaResult<(i64, i64)>
Returns high and low watermark for the specified topic and partition.
pub fn fetch_group_list<T: Into<Timeout>>(
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList>
[src]
&self,
group: Option<&str>,
timeout: T
) -> KafkaResult<GroupList>
Returns the group membership information for the given group. If no group is specified, all groups will be returned.
pub fn fatal_error(&self) -> Option<(RDKafkaErrorCode, String)>
[src]
Returns the first fatal error set on this client instance, or None
if
no fatal error has occurred.
This function is intended to be used with idempotent producers, where some errors must logically be considered fatal to retain consistency.
Auto Trait Implementations
impl<C> RefUnwindSafe for Client<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for Client<C>
impl<C> Sync for Client<C>
impl<C> Unpin for Client<C>
impl<C> UnwindSafe for Client<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
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,
pub 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, 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.
pub 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>,