Skip to content

Commit

Permalink
feat: Add From<BrokerMessage<_>> impl for InvalidMessage (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser authored Jul 2, 2024
1 parent ab87c3a commit 0b84afc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rust-arroyo/src/processing/strategies/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::types::{Message, Partition};
use crate::types::{BrokerMessage, Message, Partition};
use std::collections::HashMap;
use std::time::Duration;

Expand Down Expand Up @@ -27,6 +27,15 @@ pub struct InvalidMessage {
pub offset: u64,
}

impl<TPayload> From<&BrokerMessage<TPayload>> for InvalidMessage {
fn from(value: &BrokerMessage<TPayload>) -> Self {
Self {
partition: value.partition,
offset: value.offset,
}
}
}

/// Signals that we need to commit offsets
#[derive(Debug, Clone, PartialEq)]
pub struct CommitRequest {
Expand Down

0 comments on commit 0b84afc

Please sign in to comment.