#[non_exhaustive]pub enum RecordDecodeError {
MissingField {
path: String,
},
TypeMismatch {
path: String,
expected: &'static str,
actual: &'static str,
},
Conversion {
message: String,
},
}Expand description
A decode failure for one property. Carries the property path (dotted for
nested records, list[3] for elements) so errors read like
property speech_prefix.plain_text: expected string, got embedded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingField
The property is absent and the field is neither Option nor defaulted.
TypeMismatch
The value kind didn’t match the target type (or the payload couldn’t convert, e.g. an out-of-range integer).
Fields
Conversion
Anything else — unknown enum variant, custom with/trait conversions,
invalid payload inside an otherwise-matching kind.
Implementations§
Source§impl RecordDecodeError
impl RecordDecodeError
Sourcepub fn missing_field(field: &str) -> Self
pub fn missing_field(field: &str) -> Self
Missing-property error for a &'static str property name (codegen).
Sourcepub fn type_mismatch(expected: &'static str, actual: &'static str) -> Self
pub fn type_mismatch(expected: &'static str, actual: &'static str) -> Self
Kind mismatch without a field context (nested conversions).
Sourcepub fn conversion(message: impl Into<String>) -> Self
pub fn conversion(message: impl Into<String>) -> Self
Free-form conversion error.
Sourcepub fn unknown_variant(variant: &str) -> Self
pub fn unknown_variant(variant: &str) -> Self
Unknown enum variant string.
Sourcepub fn with_field(self, field: &str) -> Self
pub fn with_field(self, field: &str) -> Self
Prepend a property path segment to this error (used by the generated
code and the get_* helpers to thread field context upward).
Trait Implementations§
Source§impl Clone for RecordDecodeError
impl Clone for RecordDecodeError
Source§impl Debug for RecordDecodeError
impl Debug for RecordDecodeError
Source§impl Display for RecordDecodeError
impl Display for RecordDecodeError
impl Eq for RecordDecodeError
Source§impl Error for RecordDecodeError
impl Error for RecordDecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for RecordDecodeError
impl PartialEq for RecordDecodeError
impl StructuralPartialEq for RecordDecodeError
Auto Trait Implementations§
impl Freeze for RecordDecodeError
impl RefUnwindSafe for RecordDecodeError
impl Send for RecordDecodeError
impl Sync for RecordDecodeError
impl Unpin for RecordDecodeError
impl UnsafeUnpin for RecordDecodeError
impl UnwindSafe for RecordDecodeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
T in a tonic::Request