pub struct KWProducer {
pub conf: KWProducerConf,
pub producer: HpProducer<DefaultProducerContext>,
pub admin_client: Mutex<Option<Arc<AdminClient<DefaultClientContext>>>>,
}
Fields§
§conf: KWProducerConf
§producer: HpProducer<DefaultProducerContext>
§admin_client: Mutex<Option<Arc<AdminClient<DefaultClientContext>>>>
Implementations§
Source§impl KWProducer
impl KWProducer
pub fn new(conf: KWProducerConf) -> KWResult<KWProducer>
pub fn new_topic(&self) -> KWResult<NewTopic<'_>>
pub async fn send<'a, K, P>( &'a self, record: BaseRecord<'a, K, P>, ) -> Result<(), (KWError, Option<BaseRecord<'a, K, P>>)>
pub async fn publish(&self, payload: &[u8], key: &[u8]) -> KWResult<()>
pub fn flush<T: Into<Timeout>>(&self, timeout: T) -> KWResult<()>
Trait Implementations§
Source§impl OptionExt for KWProducer
impl OptionExt for KWProducer
type AdminClient = AdminClient<DefaultClientContext>
fn get_new_topics(&self) -> KWResult<Vec<NewTopic<'_>>>
fn get_brokers(&self) -> &str
fn get_log_level(&self) -> RDKafkaLogLevel
fn get_admin_client<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = KWResult<Arc<AdminClient<DefaultClientContext>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_topic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = KWResult<()>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn create_admin_client(&self) -> KWResult<Self::AdminClient>
fn get_topics<'life0, 'async_trait, C>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = KWResult<Vec<MetadataTopicWrap>>> + Send + 'async_trait>>where
C: 'async_trait + ClientContext,
Self: Sync + 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for KWProducer
impl !RefUnwindSafe for KWProducer
impl Send for KWProducer
impl Sync for KWProducer
impl Unpin for KWProducer
impl !UnwindSafe for KWProducer
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