pub struct FromVecWithNulError { /* fields omitted */ }
An error indicating that a nul byte was not in the expected position.
The vector used to create a CString
must have one and only one nul byte, positioned at the end.
This error is created by the CString::from_vec_with_nul
method. See its documentation for more.
#![feature(cstring_from_vec_with_nul)] use std::ffi::{CString, FromVecWithNulError}; let _: FromVecWithNulError = CString::from_vec_with_nul(b"f\0oo".to_vec()).unwrap_err();
impl FromVecWithNulError
[src]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]
impl<'_> Read for &'_ [u8]
impl<'_> Write for &'_ mut [u8]
[src]
Returns a slice of u8
s bytes that were attempted to convert to a CString
.
Basic usage:
#![feature(cstring_from_vec_with_nul)] use std::ffi::CString; // Some invalid bytes in a vector let bytes = b"f\0oo".to_vec(); let value = CString::from_vec_with_nul(bytes.clone()); assert_eq!(&bytes[..], value.unwrap_err().as_bytes());
pub fn into_bytes(self) -> Vec<u8>ⓘNotable traits for Vec<u8>
impl Write for Vec<u8>
[src]
Returns the bytes that were attempted to convert to a CString
.
This method is carefully constructed to avoid allocation. It will consume the error, moving out the bytes, so that a copy of the bytes does not need to be made.
Basic usage:
#![feature(cstring_from_vec_with_nul)] use std::ffi::CString; // Some invalid bytes in a vector let bytes = b"f\0oo".to_vec(); let value = CString::from_vec_with_nul(bytes.clone()); assert_eq!(bytes, value.unwrap_err().into_bytes());
impl Clone for FromVecWithNulError
[src]
fn clone(&self) -> FromVecWithNulError
[src]
fn clone_from(&mut self, source: &Self)
[src]1.0.0
impl Debug for FromVecWithNulError
[src]
impl Display for FromVecWithNulError
[src]
impl Eq for FromVecWithNulError
[src]
impl Error for FromVecWithNulError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]1.30.0
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
[src]1.0.0
fn cause(&self) -> Option<&dyn Error>
[src]1.0.0
impl PartialEq<FromVecWithNulError> for FromVecWithNulError
[src]
fn eq(&self, other: &FromVecWithNulError) -> bool
[src]
fn ne(&self, other: &FromVecWithNulError) -> bool
[src]
impl StructuralEq for FromVecWithNulError
[src]
impl StructuralPartialEq for FromVecWithNulError
[src]
impl RefUnwindSafe for FromVecWithNulError
impl Send for FromVecWithNulError
impl Sync for FromVecWithNulError
impl Unpin for FromVecWithNulError
impl UnwindSafe for FromVecWithNulError
impl<T> Any for T where
    T: 'static + ?Sized,Â
[src]
impl<T> Borrow<T> for T where
    T: ?Sized,Â
[src]
fn borrow(&self) -> &TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized,Â
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized,Â
type Item = <I as Iterator>::Item;
impl<R:Â Read + ?Sized, '_> Read for &'_ mut R
impl<W:Â Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> BorrowMut<T> for T where
    T: ?Sized,Â
[src]
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut F
impl<'_, F> Future for &'_ mut F where
    F: Unpin + Future + ?Sized,Â
type Output = <F as Future>::Output;
impl<'_, I> Iterator for &'_ mut I where
    I: Iterator + ?Sized,Â
type Item = <I as Iterator>::Item;
impl<R:Â Read + ?Sized, '_> Read for &'_ mut R
impl<W:Â Write + ?Sized, '_> Write for &'_ mut W
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
    U: From<T>,Â
[src]
impl<T> ToOwned for T where
    T: Clone,Â
[src]
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
    T: Display + ?Sized,Â
[src]
impl<T, U> TryFrom<U> for T where
    U: Into<T>,Â
[src]
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
    U: TryFrom<T>,Â
[src]
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/ffi/struct.FromVecWithNulError.html