Lines Matching refs:CStr
183 pub const fn as_char_ptr_in_const_context(c_str: &CStr) -> *const c_char { in as_char_ptr_in_const_context()
209 pub struct CStr([u8]); struct
211 impl CStr { impl
287 pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { in from_bytes_with_nul_unchecked() argument
300 pub unsafe fn from_bytes_with_nul_unchecked_mut(bytes: &mut [u8]) -> &mut CStr { in from_bytes_with_nul_unchecked_mut() argument
302 unsafe { &mut *(core::ptr::from_mut(bytes) as *mut CStr) } in from_bytes_with_nul_unchecked_mut()
458 impl fmt::Display for CStr { implementation
488 impl fmt::Debug for CStr { implementation
520 impl AsRef<BStr> for CStr { implementation
527 impl Deref for CStr { implementation
536 impl Index<ops::RangeFrom<usize>> for CStr { implementation
537 type Output = CStr;
549 impl Index<ops::RangeFull> for CStr { implementation
550 type Output = CStr;
570 impl<Idx> Index<Idx> for CStr implementation
598 const C: &$crate::str::CStr = match $crate::str::CStr::from_bytes_with_nul(S.as_bytes()) {
633 let checked_cstr = CStr::from_bytes_with_nul(good_bytes)?; in test_cstr_to_str()
642 let checked_cstr = CStr::from_bytes_with_nul(bad_bytes)?; in test_cstr_to_str_invalid_utf8()
650 let checked_cstr = CStr::from_bytes_with_nul(good_bytes)?; in test_cstr_as_str_unchecked()
659 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0")?; in test_cstr_display()
661 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0")?; in test_cstr_display()
663 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0")?; in test_cstr_display()
665 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0")?; in test_cstr_display()
677 let cstr = CStr::from_bytes_with_nul(&bytes)?; in test_cstr_display_all_bytes()
684 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0")?; in test_cstr_debug()
686 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0")?; in test_cstr_debug()
688 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0")?; in test_cstr_debug()
690 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0")?; in test_cstr_debug()
928 type Target = CStr;
933 unsafe { CStr::from_bytes_with_nul_unchecked(self.buf.as_slice()) } in deref()
941 unsafe { CStr::from_bytes_with_nul_unchecked_mut(self.buf.as_mut_slice()) } in deref_mut()
945 impl<'a> TryFrom<&'a CStr> for CString {
948 fn try_from(cstr: &'a CStr) -> Result<CString, AllocError> { in try_from()