pub struct CStringDecodeError {
pub index: usize,
}Available on crate feature
alloc only.Expand description
A C-like string could not be decoded.
This error is generatead when <CString as Decode>::decode encounteres a null byte within bounds.
Note that although any null value is theoretically also the string’s null terminator, the implementations for CStr and CString use the same encoding scheme as [u8].
This is mainly for efficiency’s sake (as to allow the entire stream to be read at once), but this also allows for the aforementioned case to happen.
Fields§
§index: usizeThe index of the null value.
Trait Implementations§
Source§impl Debug for CStringDecodeError
impl Debug for CStringDecodeError
Source§impl Display for CStringDecodeError
impl Display for CStringDecodeError
Source§impl Error for CStringDecodeError
impl Error for CStringDecodeError
1.30.0 · 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<CStringDecodeError> for GenericDecodeError
impl From<CStringDecodeError> for GenericDecodeError
Source§fn from(value: CStringDecodeError) -> Self
fn from(value: CStringDecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CStringDecodeError
impl RefUnwindSafe for CStringDecodeError
impl Send for CStringDecodeError
impl Sync for CStringDecodeError
impl Unpin for CStringDecodeError
impl UnwindSafe for CStringDecodeError
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