Struct NulError
struct NulError(_, _)
An error indicating that an interior nul byte was found.
While Rust strings may contain nul bytes in the middle, C strings can't, as that byte would effectively truncate the string.
This error is created by the [new]CString::new method on
CString. See its documentation for more.
Examples
use ;
let _: NulError = new.unwrap_err;
Implementations
impl NulError
fn nul_position(self: &Self) -> usizeReturns the position of the nul byte in the slice that caused
CString::newto fail.Examples
use CString; let nul_error = new.unwrap_err; assert_eq!; let nul_error = new.unwrap_err; assert_eq!;fn into_vec(self: Self) -> Vec<u8>Consumes this error, returning the underlying vector of bytes which generated the error in the first place.
Examples
use CString; let nul_error = new.unwrap_err; assert_eq!;
impl Clone for NulError
fn clone(self: &Self) -> NulError
impl Debug for NulError
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Display for NulError
fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for NulError
impl Error for NulError
impl Freeze for NulError
impl PartialEq for NulError
fn eq(self: &Self, other: &NulError) -> bool
impl RefUnwindSafe for NulError
impl Send for NulError
impl StructuralPartialEq for NulError
impl Sync for NulError
impl Unpin for NulError
impl UnwindSafe for NulError
impl<T> Any for NulError
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for NulError
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for NulError
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for NulError
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for NulError
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for NulError
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for NulError
fn to_string(self: &Self) -> String
impl<T, U> Into for NulError
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for NulError
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for NulError
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>