Lines Matching refs:BStr
13 pub struct BStr([u8]); struct
15 impl BStr { impl
32 unsafe { &*(bytes as *const [u8] as *const BStr) } in from_bytes() constant
46 pub fn strip_prefix(&self, pattern: impl AsRef<Self>) -> Option<&BStr> { in strip_prefix() argument
53 impl fmt::Display for BStr { implementation
83 impl fmt::Debug for BStr { implementation
119 impl Deref for BStr { implementation
128 impl PartialEq for BStr { implementation
134 impl<Idx> Index<Idx> for BStr implementation
141 BStr::from_bytes(&self.0[index]) in index()
145 impl AsRef<BStr> for [u8] {
146 fn as_ref(&self) -> &BStr { in as_ref() argument
147 BStr::from_bytes(self) in as_ref()
151 impl AsRef<BStr> for BStr { implementation
152 fn as_ref(&self) -> &BStr { in as_ref() argument
173 const C: &'static $crate::str::BStr = $crate::str::BStr::from_bytes(S.as_bytes());
489 impl AsRef<BStr> for CStr {
491 fn as_ref(&self) -> &BStr { in as_ref() argument
492 BStr::from_bytes(self.as_bytes()) in as_ref()
497 type Target = BStr;
542 BStr: Index<Idx>,
544 type Output = <BStr as Index<Idx>>::Output;
678 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_display()
680 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_display()
682 let others = BStr::from_bytes(b"\x01"); in test_bstr_display()
684 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_display()
686 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_display()
692 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_debug()
694 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_debug()
696 let others = BStr::from_bytes(b"\x01"); in test_bstr_debug()
698 let non_ascii = BStr::from_bytes(b"d\xe9j\xe0 vu"); in test_bstr_debug()
700 let good_bytes = BStr::from_bytes(b"\xf0\x9f\xa6\x80"); in test_bstr_debug()