Lines Matching defs:u8
13 pub struct BStr([u8]);
28 /// Creates a [`BStr`] from a `[u8]`.
30 pub const fn from_bytes(bytes: &[u8]) -> &Self {
31 // SAFETY: `BStr` is transparent to `[u8]`.
32 unsafe { &*(bytes as *const [u8] as *const BStr) }
101 type Target = [u8];
152 pub struct CStr([u8]);
198 /// Creates a [`CStr`] from a `[u8]`.
202 pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, CStrConvertError> {
222 /// Creates a [`CStr`] from a `[u8]` without performing any additional
230 pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr {
235 /// Creates a mutable [`CStr`] from a `[u8]` without performing any
243 pub unsafe fn from_bytes_with_nul_unchecked_mut(bytes: &mut [u8]) -> &mut CStr {
245 unsafe { &mut *(bytes as *mut [u8] as *mut CStr) }
256 pub fn as_bytes(&self) -> &[u8] {
262 pub const fn as_bytes_with_nul(&self) -> &[u8] {
602 let mut bytes: [u8; 256] = [0; 256];
604 for i in u8::MIN..=u8::MAX {
685 pub(crate) unsafe fn from_ptrs(pos: *mut u8, end: *mut u8) -> Self {
700 pub(crate) unsafe fn from_buffer(buf: *mut u8, len: usize) -> Self {
714 pub(crate) fn pos(&self) -> *mut u8 {
739 self.pos as *mut u8,
762 pub(crate) unsafe fn from_buffer(buf: *mut u8, len: usize) -> Self {
814 buf: KVec<u8>,