pub struct KafkaSource<T> { /* private fields */ }
Expand description
A source that reads from Kafka
Implementations§
Source§impl<T> KafkaSource<T>
impl<T> KafkaSource<T>
Sourcepub fn new(config: &KafkaConfig) -> SourceResult<Self>
pub fn new(config: &KafkaConfig) -> SourceResult<Self>
Create a new Kafka source with the given configuration
§Errors
Returns an error if:
- Failed to create Kafka consumer
- Failed to subscribe to topic
- Invalid configuration parameters
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Set the timeout for reading messages
Returns a new KafkaSource
with the updated timeout
Trait Implementations§
Source§impl<T> FlowComponent for KafkaSource<T>
impl<T> FlowComponent for KafkaSource<T>
Auto Trait Implementations§
impl<T> Freeze for KafkaSource<T>
impl<T> !RefUnwindSafe for KafkaSource<T>
impl<T> Send for KafkaSource<T>where
T: Send,
impl<T> Sync for KafkaSource<T>where
T: Sync,
impl<T> Unpin for KafkaSource<T>where
T: Unpin,
impl<T> !UnwindSafe for KafkaSource<T>
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