pub struct Record { /* private fields */ }
Expand description
A record in Redpanda.
A record is a key-value pair of bytes, along with a collection of RecordHeader
.
Records are generated as the result of any transforms that act upon a BorrowedRecord
.
Implementations§
Source§impl Record
impl Record
Sourcepub fn new(key: Option<Vec<u8>>, value: Option<Vec<u8>>) -> Record
pub fn new(key: Option<Vec<u8>>, value: Option<Vec<u8>>) -> Record
Create a new record with the given key and value.
Sourcepub fn new_with_headers(
key: Option<Vec<u8>>,
value: Option<Vec<u8>>,
headers: Vec<RecordHeader>,
) -> Record
pub fn new_with_headers( key: Option<Vec<u8>>, value: Option<Vec<u8>>, headers: Vec<RecordHeader>, ) -> Record
Create a new record with the given, key, value and headers.
Sourcepub fn add_header(&mut self, header: RecordHeader)
pub fn add_header(&mut self, header: RecordHeader)
Append a header to this record.
Sourcepub fn headers(&self) -> impl ExactSizeIterator
pub fn headers(&self) -> impl ExactSizeIterator
Returns a collection of headers for this record.
Trait Implementations§
Source§impl<'a> From<&'a Record> for BorrowedRecord<'a>
impl<'a> From<&'a Record> for BorrowedRecord<'a>
Source§fn from(record: &'a Record) -> BorrowedRecord<'a>
fn from(record: &'a Record) -> BorrowedRecord<'a>
Converts to this type from the input type.
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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