#[non_exhaustive]pub enum StringErrorKind {
Primitive(PrimitiveError),
InvalidUtf8 {
source: Utf8Error,
},
UnexpectedNull,
NegativeLength {
length: i32,
},
TooLong {
length: usize,
max: usize,
},
}Expand description
Specific reason a string read/write failed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Primitive(PrimitiveError)
Underlying primitive read failed (length prefix or bytes).
InvalidUtf8
String bytes are not valid UTF-8.
UnexpectedNull
Non-nullable variant got the null marker (negative length / 0 varint).
NegativeLength
Length prefix is negative on a non-nullable encoding.
TooLong
String length exceeds the maximum encodable length.
Trait Implementations§
Source§impl Debug for StringErrorKind
impl Debug for StringErrorKind
Source§impl Display for StringErrorKind
impl Display for StringErrorKind
Source§impl Error for StringErrorKind
impl Error for StringErrorKind
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()
Source§impl From<PrimitiveError> for StringErrorKind
impl From<PrimitiveError> for StringErrorKind
Source§fn from(source: PrimitiveError) -> Self
fn from(source: PrimitiveError) -> Self
Converts to this type from the input type.
Source§impl From<StringErrorKind> for StringError
impl From<StringErrorKind> for StringError
Source§fn from(kind: StringErrorKind) -> Self
fn from(kind: StringErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StringErrorKind
impl RefUnwindSafe for StringErrorKind
impl Send for StringErrorKind
impl Sync for StringErrorKind
impl Unpin for StringErrorKind
impl UnsafeUnpin for StringErrorKind
impl UnwindSafe for StringErrorKind
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