pub struct NulError(_, _);
Expand description
Implementations§
source§impl NulError
impl NulError
1.0.0 · sourcepub fn nul_position(&self) -> usize
pub fn nul_position(&self) -> usize
返回导致 CString::new
失败的切片中 nul 字节的位置。
Examples
use std::ffi::CString;
let nul_error = CString::new("foo\0bar").unwrap_err();
assert_eq!(nul_error.nul_position(), 3);
let nul_error = CString::new("foo bar\0").unwrap_err();
assert_eq!(nul_error.nul_position(), 7);
RunTrait Implementations§
1.0.0 · source§impl Error for NulError
impl Error for NulError
impl Eq for NulError
impl StructuralEq for NulError
impl StructuralPartialEq for NulError
Auto Trait Implementations§
impl RefUnwindSafe for NulError
impl Send for NulError
impl Sync for NulError
impl Unpin for NulError
impl UnwindSafe for NulError
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