pub struct Kafka {
pub brokers: Vec<String>,
pub topic: String,
pub message_timeout_ms: u32,
pub delivery_wait_secs: u64,
/* private fields */
}Expand description
Kafka client configuration for audit message production.
The [FutureProducer] is lazily created on the first
call to Audit::produce_message and reused for all
subsequent calls via an internal OnceLock.
Fields§
§brokers: Vec<String>Bootstrap broker list, e.g. vec!["kafka.example.com:9092"].
topic: StringKafka topic that audit messages are published to.
message_timeout_ms: u32librdkafka message.timeout.ms: how long a queued audit
message tries to deliver before being dropped.
delivery_wait_secs: u64How long produce_message blocks waiting for delivery
confirmation. Zero (default) is fire-and-forget.
Implementations§
Trait Implementations§
Source§impl Audit for Kafka
impl Audit for Kafka
Source§async fn produce_message(&self, data: &[u8]) -> Result<(), MantaError>
async fn produce_message(&self, data: &[u8]) -> Result<(), MantaError>
Publish a single audit message payload. Implementations are
expected to be fire-and-forget — failures should be logged but
not propagated to the caller, since audit failures must not
abort the outer operation.
Source§impl<'de> Deserialize<'de> for Kafka
impl<'de> Deserialize<'de> for Kafka
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for Kafka
impl !RefUnwindSafe for Kafka
impl Send for Kafka
impl Sync for Kafka
impl Unpin for Kafka
impl !UnwindSafe for Kafka
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.