Lines Matching refs:CStr

200 pub struct CStr([u8]);  struct
202 impl CStr { implementation
278 pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { in from_bytes_with_nul_unchecked() argument
291 pub unsafe fn from_bytes_with_nul_unchecked_mut(bytes: &mut [u8]) -> &mut CStr { in from_bytes_with_nul_unchecked_mut() argument
293 unsafe { &mut *(bytes as *mut [u8] as *mut CStr) } in from_bytes_with_nul_unchecked_mut()
427 impl fmt::Display for CStr { implementation
457 impl fmt::Debug for CStr { implementation
489 impl AsRef<BStr> for CStr { implementation
496 impl Deref for CStr { implementation
505 impl Index<ops::RangeFrom<usize>> for CStr { implementation
506 type Output = CStr;
518 impl Index<ops::RangeFull> for CStr { implementation
519 type Output = CStr;
539 impl<Idx> Index<Idx> for CStr implementation
567 const C: &$crate::str::CStr = match $crate::str::CStr::from_bytes_with_nul(S.as_bytes()) {
619 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_to_str()
628 let checked_cstr = CStr::from_bytes_with_nul(bad_bytes).unwrap(); in test_cstr_to_str_panic()
635 let checked_cstr = CStr::from_bytes_with_nul(good_bytes).unwrap(); in test_cstr_as_str_unchecked()
643 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_display()
645 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_display()
647 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_display()
649 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_display()
660 let cstr = CStr::from_bytes_with_nul(&bytes).unwrap(); in test_cstr_display_all_bytes()
666 let hello_world = CStr::from_bytes_with_nul(b"hello, world!\0").unwrap(); in test_cstr_debug()
668 let non_printables = CStr::from_bytes_with_nul(b"\x01\x09\x0a\0").unwrap(); in test_cstr_debug()
670 let non_ascii = CStr::from_bytes_with_nul(b"d\xe9j\xe0 vu\0").unwrap(); in test_cstr_debug()
672 let good_bytes = CStr::from_bytes_with_nul(b"\xf0\x9f\xa6\x80\0").unwrap(); in test_cstr_debug()
907 type Target = CStr;
912 unsafe { CStr::from_bytes_with_nul_unchecked(self.buf.as_slice()) } in deref()
920 unsafe { CStr::from_bytes_with_nul_unchecked_mut(self.buf.as_mut_slice()) } in deref_mut()
924 impl<'a> TryFrom<&'a CStr> for CString {
927 fn try_from(cstr: &'a CStr) -> Result<CString, AllocError> { in try_from()