pub struct SourceEnvelope {
pub record: SourceRecord,
pub offset: Option<Offset>,
}Expand description
A source record together with optional checkpoint information.
This struct represents a single record emitted by a source connector, along with optional checkpoint information.
Fields§
§record: SourceRecordThe record to publish to Danube.
offset: Option<Offset>Optional offset/checkpoint to commit after successful publish.
Implementations§
Source§impl SourceEnvelope
impl SourceEnvelope
Sourcepub fn new(record: SourceRecord) -> Self
pub fn new(record: SourceRecord) -> Self
Create an envelope without checkpoint information.
Sourcepub fn with_offset(record: SourceRecord, offset: Offset) -> Self
pub fn with_offset(record: SourceRecord, offset: Offset) -> Self
Create an envelope with an offset to commit after successful delivery.
Sourcepub fn record(&self) -> &SourceRecord
pub fn record(&self) -> &SourceRecord
Borrow the record carried by this envelope.
Sourcepub fn offset(&self) -> Option<&Offset>
pub fn offset(&self) -> Option<&Offset>
Borrow the offset carried by this envelope, if present.
Sourcepub fn into_parts(self) -> (SourceRecord, Option<Offset>)
pub fn into_parts(self) -> (SourceRecord, Option<Offset>)
Split this envelope into its record and optional offset parts.
Trait Implementations§
Source§impl Clone for SourceEnvelope
impl Clone for SourceEnvelope
Source§fn clone(&self) -> SourceEnvelope
fn clone(&self) -> SourceEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceEnvelope
impl Debug for SourceEnvelope
Source§impl From<SourceRecord> for SourceEnvelope
impl From<SourceRecord> for SourceEnvelope
Source§fn from(record: SourceRecord) -> Self
fn from(record: SourceRecord) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SourceEnvelope
impl RefUnwindSafe for SourceEnvelope
impl Send for SourceEnvelope
impl Sync for SourceEnvelope
impl Unpin for SourceEnvelope
impl UnsafeUnpin for SourceEnvelope
impl UnwindSafe for SourceEnvelope
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request