pub struct RecordDeserializationError { /* private fields */ }Expand description
This error is raised for any error that occurs while deserializing records received by the
consumer using the configured Deserializer.
§Translation notes
No protocol code.
Implementations§
Source§impl RecordDeserializationError
impl RecordDeserializationError
Sourcepub fn new(
origin: DeserializationErrorOrigin,
partition: TopicPartition,
offset: i64,
timestamp: i64,
timestamp_type: TimestampType,
key_buffer: Option<Vec<u8>>,
value_buffer: Option<Vec<u8>>,
headers: Option<RecordHeaders>,
message: impl Into<String>,
) -> Self
pub fn new( origin: DeserializationErrorOrigin, partition: TopicPartition, offset: i64, timestamp: i64, timestamp_type: TimestampType, key_buffer: Option<Vec<u8>>, value_buffer: Option<Vec<u8>>, headers: Option<RecordHeaders>, message: impl Into<String>, ) -> Self
Creates a deserialization error with the full context of the offending record; the
cause is attached by Self::with_source.
§Arguments
origin- which side of the record (key or value) failed to deserializepartition- the partition of the recordoffset- the offset of the recordtimestamp- the timestamp of the recordtimestamp_type- the timestamp type of the recordkey_buffer- the raw key bytes,Nonefor a null keyvalue_buffer- the raw value bytes,Nonefor a null valueheaders- the record headersmessage- the error’s message
Sourcepub fn origin(&self) -> DeserializationErrorOrigin
pub fn origin(&self) -> DeserializationErrorOrigin
Returns which side of the record (key or value) failed to deserialize.
Sourcepub fn topic_partition(&self) -> &TopicPartition
pub fn topic_partition(&self) -> &TopicPartition
Returns the partition of the offending record.
Sourcepub fn timestamp_type(&self) -> TimestampType
pub fn timestamp_type(&self) -> TimestampType
Returns the timestamp type of the offending record.
Sourcepub fn key_buffer(&self) -> Option<&[u8]>
pub fn key_buffer(&self) -> Option<&[u8]>
Returns the raw key bytes, or None if absent.
Sourcepub fn value_buffer(&self) -> Option<&[u8]>
pub fn value_buffer(&self) -> Option<&[u8]>
Returns the raw value bytes, or None if absent.
Sourcepub fn headers(&self) -> Option<&RecordHeaders>
pub fn headers(&self) -> Option<&RecordHeaders>
Returns the record headers, or None if absent.
Sourcepub fn with_source(self, source: Error) -> Self
pub fn with_source(self, source: Error) -> Self
Trait Implementations§
Source§impl Clone for RecordDeserializationError
impl Clone for RecordDeserializationError
Source§fn clone(&self) -> RecordDeserializationError
fn clone(&self) -> RecordDeserializationError
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 RecordDeserializationError
impl Debug for RecordDeserializationError
Source§impl Display for RecordDeserializationError
impl Display for RecordDeserializationError
Source§impl Error for RecordDeserializationError
impl Error for RecordDeserializationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for RecordDeserializationError
impl RefUnwindSafe for RecordDeserializationError
impl Send for RecordDeserializationError
impl Sync for RecordDeserializationError
impl Unpin for RecordDeserializationError
impl UnsafeUnpin for RecordDeserializationError
impl UnwindSafe for RecordDeserializationError
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