Struct alloc::ffi::IntoStringError
1.64.0 · source · pub struct IntoStringError { /* private fields */ }
Expand description
将 CString
转换为 String
时,指示 UTF-8 无效的错误。
CString
只是一个带有 nul 终止符的字节缓冲区的包装器;
CString::into_string
对这些字节执行 UTF-8 验证,并可能返回此错误。
该 struct
由 CString::into_string()
创建。有关更多信息,请参见其文档。
Implementations§
source§impl IntoStringError
impl IntoStringError
1.7.0 · sourcepub fn into_cstring(self) -> CString
pub fn into_cstring(self) -> CString
消耗此错误,返回产生错误的原始 CString
。
1.7.0 · sourcepub fn utf8_error(&self) -> Utf8Error
pub fn utf8_error(&self) -> Utf8Error
访问根本的 UTF-8 错误,该错误是引起此错误的原因。
Trait Implementations§
source§impl Clone for IntoStringError
impl Clone for IntoStringError
source§fn clone(&self) -> IntoStringError
fn clone(&self) -> IntoStringError
返回值的副本。 Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
从
source
执行复制分配。 Read moresource§impl Debug for IntoStringError
impl Debug for IntoStringError
1.7.0 · source§impl Display for IntoStringError
impl Display for IntoStringError
1.7.0 · source§impl Error for IntoStringError
impl Error for IntoStringError
source§impl PartialEq<IntoStringError> for IntoStringError
impl PartialEq<IntoStringError> for IntoStringError
impl Eq for IntoStringError
impl StructuralEq for IntoStringError
impl StructuralPartialEq for IntoStringError
Auto Trait Implementations§
impl RefUnwindSafe for IntoStringError
impl Send for IntoStringError
impl Sync for IntoStringError
impl Unpin for IntoStringError
impl UnwindSafe for IntoStringError
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
从拥有的值中借用。 Read more