[−][src]Struct raw_string::RawStr
A str with unchecked contents.
It is basically a [u8], to be interpreted as string.
Unlike str, there are no guarantees about the contents being valid UTF-8.
Unlike [u8], its Display and Debug implementations show a string, not an
array of numbers.
Implementations
impl RawStr[src]
pub fn from<S: AsRef<RawStr> + ?Sized>(s: &S) -> &Self[src]
pub fn from_bytes(bytes: &[u8]) -> &Self[src]
pub fn from_str(bytes: &str) -> &Self[src]
pub fn as_bytes(&self) -> &[u8][src]
pub fn from_bytes_mut(bytes: &mut [u8]) -> &mut Self[src]
pub fn as_bytes_mut(&mut self) -> &mut [u8][src]
pub fn len(&self) -> usize[src]
pub fn is_empty(&self) -> bool[src]
pub fn as_ptr(&self) -> *const u8[src]
pub fn first(&self) -> Option<u8>[src]
pub fn first_mut(&mut self) -> Option<&mut u8>[src]
pub fn last(&self) -> Option<u8>[src]
pub fn last_mut(&mut self) -> Option<&mut u8>[src]
pub fn split_first(&self) -> Option<(u8, &RawStr)>[src]
pub fn split_first_mut(&mut self) -> Option<(&mut u8, &mut RawStr)>[src]
pub fn split_last(&self) -> Option<(u8, &RawStr)>[src]
pub fn split_last_mut(&mut self) -> Option<(&mut u8, &mut RawStr)>[src]
pub fn split_at(&self, mid: usize) -> (&RawStr, &RawStr)[src]
pub fn split_at_mut(&mut self, mid: usize) -> (&mut RawStr, &mut RawStr)[src]
pub fn contains_byte(&self, x: u8) -> bool[src]
pub fn starts_with<T: AsRef<RawStr>>(&self, x: T) -> bool[src]
pub fn ends_with<T: AsRef<RawStr>>(&self, x: T) -> bool[src]
pub fn get<I: RawStrIndex>(&self, index: I) -> Option<&I::Output>[src]
pub fn get_mut<I: RawStrIndex>(&mut self, index: I) -> Option<&mut I::Output>[src]
pub unsafe fn get_unchecked<I: RawStrIndex>(&self, index: I) -> &I::Output[src]
pub unsafe fn get_unchecked_mut<I: RawStrIndex>(
&mut self,
index: I
) -> &mut I::Output[src]
&mut self,
index: I
) -> &mut I::Output
pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &RawStr[src]
pub unsafe fn slice_mut_unchecked(
&mut self,
begin: usize,
end: usize
) -> &mut RawStr[src]
&mut self,
begin: usize,
end: usize
) -> &mut RawStr
pub fn bytes(&self) -> Cloned<Iter<'_, u8>>[src]
pub fn bytes_mut(&mut self) -> IterMut<'_, u8>[src]
pub fn utf8_chunks(&self) -> Utf8ChunksIter<'_>ⓘNotable traits for Utf8ChunksIter<'a>
impl<'a> Iterator for Utf8ChunksIter<'a> type Item = Utf8Chunk<'a>;[src]
Notable traits for Utf8ChunksIter<'a>
impl<'a> Iterator for Utf8ChunksIter<'a> type Item = Utf8Chunk<'a>;Iterate over chunks of valid UTF-8.
The iterator iterates over the chunks of valid UTF-8 separated by any broken characters, which could be replaced by the unicode replacement character.
pub fn to_str(&self) -> Result<&str, Utf8Error>[src]
pub fn to_osstr(&self) -> Result<&OsStr, Utf8Error>[src]
Convert to an OsStr.
On Unix, it never fails. On other platforms, it must be encoded as UTF-8.
A never-failing version for Unix only is available as
unix::RawStrExt::as_osstr.
pub fn to_path(&self) -> Result<&Path, Utf8Error>[src]
Convert to a Path.
On Unix, it never fails. On other platforms, it must be encoded as UTF-8.
A never-failing version for Unix only is available as
unix::RawStrExt::as_path.
pub fn is_ascii(&self) -> bool[src]
pub fn eq_ignore_ascii_case(&self, other: &RawStr) -> bool[src]
pub fn make_ascii_uppercase(&mut self)[src]
pub fn make_ascii_lowercase(&mut self)[src]
Trait Implementations
impl AsRef<[u8]> for RawStr[src]
impl AsRef<RawStr> for RawStr[src]
impl AsRef<RawStr> for [u8][src]
impl AsRef<RawStr> for str[src]
impl AsRef<RawStr> for RawString[src]
impl Borrow<RawStr> for RawString[src]
impl Debug for RawStr[src]
impl<'a> Default for &'a RawStr[src]
impl<'a> Default for &'a mut RawStr[src]
impl Display for RawStr[src]
impl Eq for RawStr[src]
impl<'a> From<&'a [u8]> for &'a RawStr[src]
impl<'a> From<&'a RawStr> for RawString[src]
impl<'a> From<&'a str> for &'a RawStr[src]
impl Hash for RawStr[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<I: RawStrIndex> Index<I> for RawStr[src]
type Output = I::Output
The returned type after indexing.
fn index(&self, index: I) -> &I::Output[src]
impl<I: RawStrIndex> IndexMut<I> for RawStr[src]
impl<'a> IntoIterator for &'a RawStr[src]
type Item = u8
The type of the elements being iterated over.
type IntoIter = Cloned<Iter<'a, u8>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a> IntoIterator for &'a mut RawStr[src]
type Item = &'a mut u8
The type of the elements being iterated over.
type IntoIter = IterMut<'a, u8>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
impl Ord for RawStr[src]
fn cmp(&self, other: &RawStr) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl<'_> PartialEq<&'_ [u8]> for RawStr[src]
impl<'_> PartialEq<&'_ RawStr> for RawString[src]
impl<'_> PartialEq<&'_ str> for RawStr[src]
impl PartialEq<[u8]> for RawStr[src]
impl PartialEq<RawStr> for RawStr[src]
impl PartialEq<RawStr> for str[src]
impl PartialEq<RawStr> for [u8][src]
impl<'_> PartialEq<RawStr> for &'_ str[src]
impl<'_> PartialEq<RawStr> for &'_ [u8][src]
impl PartialEq<RawStr> for RawString[src]
impl PartialEq<RawString> for RawStr[src]
impl<'_> PartialEq<RawString> for &'_ RawStr[src]
impl PartialEq<str> for RawStr[src]
impl<'_> PartialOrd<&'_ [u8]> for RawStr[src]
fn partial_cmp(&self, other: &&[u8]) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialOrd<&'_ RawStr> for RawString[src]
fn partial_cmp(&self, other: &&RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialOrd<&'_ str> for RawStr[src]
fn partial_cmp(&self, other: &&str) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<[u8]> for RawStr[src]
fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<RawStr> for RawStr[src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
fn lt(&self, other: &RawStr) -> bool[src]
fn le(&self, other: &RawStr) -> bool[src]
fn gt(&self, other: &RawStr) -> bool[src]
fn ge(&self, other: &RawStr) -> bool[src]
impl PartialOrd<RawStr> for str[src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<RawStr> for [u8][src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialOrd<RawStr> for &'_ str[src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialOrd<RawStr> for &'_ [u8][src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<RawStr> for RawString[src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<RawString> for RawStr[src]
fn partial_cmp(&self, other: &RawString) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<'_> PartialOrd<RawString> for &'_ RawStr[src]
fn partial_cmp(&self, other: &RawString) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialOrd<str> for RawStr[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl RawStrExt for RawStr[src]
Conversions only available on unix.
impl StructuralEq for RawStr[src]
impl StructuralPartialEq for RawStr[src]
impl ToOwned for RawStr[src]
Auto Trait Implementations
impl RefUnwindSafe for RawStr
impl Send for RawStr
impl Sync for RawStr
impl Unpin for RawStr
impl UnwindSafe for RawStr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,