Enum FromBytesWithNulError

pub enum FromBytesWithNulError

An error indicating that a nul byte was not in the expected position.

The slice used to create a CStr must have one and only one nul byte, positioned at the end.

This error is created by the CStr::from_bytes_with_nul method. See its documentation for more.

Examples

use std::ffi::{CStr, FromBytesWithNulError};

let _: FromBytesWithNulError = CStr::from_bytes_with_nul(b"f\0oo").unwrap_err();

Variants

InteriorNul { position: usize }

Data provided contains an interior nul byte at byte position.

NotNulTerminated

Data provided is not nul terminated.

Trait Implementations

impl Clone for FromBytesWithNulError

fn clone(&self) -> FromBytesWithNulError

impl Copy for FromBytesWithNulError

impl Debug for FromBytesWithNulError

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for FromBytesWithNulError

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Eq for FromBytesWithNulError

fn assert_fields_are_eq(&self)

impl Error for FromBytesWithNulError

impl PartialEq for FromBytesWithNulError

fn eq(&self, other: &FromBytesWithNulError) -> bool

impl StructuralPartialEq for FromBytesWithNulError

impl TrivialClone for FromBytesWithNulError

Auto Trait Implementations

impl Freeze for FromBytesWithNulError

impl RefUnwindSafe for FromBytesWithNulError

impl Send for FromBytesWithNulError

impl Sync for FromBytesWithNulError

impl Unpin for FromBytesWithNulError

impl UnsafeUnpin for FromBytesWithNulError

impl UnwindSafe for FromBytesWithNulError

Blanket Implementations

impl<T> Any for FromBytesWithNulError where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FromBytesWithNulError where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FromBytesWithNulError where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for FromBytesWithNulError where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FromBytesWithNulError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Printable for FromBytesWithNulError where T: Copy + Debug,

impl<T> SizeHint for FromBytesWithNulError where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for FromBytesWithNulError

impl<T, U> Into<U> for FromBytesWithNulError where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for FromBytesWithNulError where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for FromBytesWithNulError where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>