Skip to content

Commit

Permalink
Merge pull request #16316 from vbotbuildovich/backport-pr-16314-v23.3…
Browse files Browse the repository at this point in the history
….x-217

[v23.3.x] transform-sdk/rust: update rustdocs
  • Loading branch information
rockwotj committed Jan 26, 2024
2 parents f9d6dda + ed3f8cb commit d421bb8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/transform-sdk/rust/core-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,16 @@ impl<'a> From<&'a WrittenRecord<'a>> for BorrowedRecord<'a> {
}
}

/// A trait that can receive a stream of records and output them a destination topic.
/// An internal trait that can receive a stream of records and output them a destination topic.
///
/// As a user of this framework you should not need to implement this, unless you're writing a mock
/// implementation for testing.
pub trait RecordSink {
/// Write a record to the output topic returning any errors.
fn write(&mut self, r: BorrowedRecord<'_>) -> Result<(), WriteError>;
}

/// A writer trait for output transformed records to the destination topic.
/// A struct that writes transformed records to the output topic..
pub struct RecordWriter<'a> {
sink: &'a mut dyn RecordSink,
}
Expand Down

0 comments on commit d421bb8

Please sign in to comment.