Struct raw_string::RawStr [−][src]
pub struct RawStr { /* fields omitted */ }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.
Very similar to the Unix implementation of OsStr.
Methods
impl RawStr[src]
impl RawStrpub fn from_bytes(bytes: &[u8]) -> &Self[src]
pub fn from_bytes(bytes: &[u8]) -> &Selfpub fn from_str(bytes: &str) -> &Self[src]
pub fn from_str(bytes: &str) -> &Selfpub fn as_bytes(&self) -> &[u8][src]
pub fn as_bytes(&self) -> &[u8]pub fn from_mut_bytes(bytes: &mut [u8]) -> &mut Self[src]
pub fn from_mut_bytes(bytes: &mut [u8]) -> &mut Selfpub fn as_mut_bytes(&mut self) -> &mut [u8][src]
pub fn as_mut_bytes(&mut self) -> &mut [u8]pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizepub fn iter(&self) -> Iter<u8>[src]
pub fn iter(&self) -> Iter<u8>Trait Implementations
impl PartialEq for RawStr[src]
impl PartialEq for RawStrfn eq(&self, other: &RawStr) -> bool[src]
fn eq(&self, other: &RawStr) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &RawStr) -> bool[src]
fn ne(&self, other: &RawStr) -> boolThis method tests for !=.
impl Eq for RawStr[src]
impl Eq for RawStrimpl PartialOrd for RawStr[src]
impl PartialOrd for RawStrfn partial_cmp(&self, other: &RawStr) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &RawStr) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, other: &RawStr) -> bool[src]
fn lt(&self, other: &RawStr) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &RawStr) -> bool[src]
fn le(&self, other: &RawStr) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &RawStr) -> bool[src]
fn gt(&self, other: &RawStr) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &RawStr) -> bool[src]
fn ge(&self, other: &RawStr) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for RawStr[src]
impl Ord for RawStrfn cmp(&self, other: &RawStr) -> Ordering[src]
fn cmp(&self, other: &RawStr) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl Hash for RawStr[src]
impl Hash for RawStrfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl AsRef<RawStr> for RawStr[src]
impl AsRef<RawStr> for RawStrimpl AsRef<RawStr> for [u8][src]
impl AsRef<RawStr> for [u8]impl AsRef<RawStr> for str[src]
impl AsRef<RawStr> for strimpl AsRef<[u8]> for RawStr[src]
impl AsRef<[u8]> for RawStrimpl<'a> Default for &'a RawStr[src]
impl<'a> Default for &'a RawStrimpl<'a> Default for &'a mut RawStr[src]
impl<'a> Default for &'a mut RawStrimpl Index<Range<usize>> for RawStr[src]
impl Index<Range<usize>> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &RawStr[src]
fn index(&self, index: Range<usize>) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<Range<usize>> for RawStr[src]
impl IndexMut<Range<usize>> for RawStrfn index_mut(&mut self, index: Range<usize>) -> &mut RawStr[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl Index<RangeFrom<usize>> for RawStr[src]
impl Index<RangeFrom<usize>> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &RawStr[src]
fn index(&self, index: RangeFrom<usize>) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<RangeFrom<usize>> for RawStr[src]
impl IndexMut<RangeFrom<usize>> for RawStrfn index_mut(&mut self, index: RangeFrom<usize>) -> &mut RawStr[src]
fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl Index<RangeFull> for RawStr[src]
impl Index<RangeFull> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeFull) -> &RawStr[src]
fn index(&self, index: RangeFull) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<RangeFull> for RawStr[src]
impl IndexMut<RangeFull> for RawStrfn index_mut(&mut self, index: RangeFull) -> &mut RawStr[src]
fn index_mut(&mut self, index: RangeFull) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl Index<RangeInclusive<usize>> for RawStr[src]
impl Index<RangeInclusive<usize>> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeInclusive<usize>) -> &RawStr[src]
fn index(&self, index: RangeInclusive<usize>) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<RangeInclusive<usize>> for RawStr[src]
impl IndexMut<RangeInclusive<usize>> for RawStrfn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut RawStr[src]
fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl Index<RangeTo<usize>> for RawStr[src]
impl Index<RangeTo<usize>> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &RawStr[src]
fn index(&self, index: RangeTo<usize>) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<RangeTo<usize>> for RawStr[src]
impl IndexMut<RangeTo<usize>> for RawStrfn index_mut(&mut self, index: RangeTo<usize>) -> &mut RawStr[src]
fn index_mut(&mut self, index: RangeTo<usize>) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl Index<RangeToInclusive<usize>> for RawStr[src]
impl Index<RangeToInclusive<usize>> for RawStrtype Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeToInclusive<usize>) -> &RawStr[src]
fn index(&self, index: RangeToInclusive<usize>) -> &RawStrPerforms the indexing (container[index]) operation.
impl IndexMut<RangeToInclusive<usize>> for RawStr[src]
impl IndexMut<RangeToInclusive<usize>> for RawStrfn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut RawStr[src]
fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut RawStrPerforms the mutable indexing (container[index]) operation.
impl<'a> IntoIterator for &'a RawStr[src]
impl<'a> IntoIterator for &'a RawStrtype Item = &'a u8
The type of the elements being iterated over.
type IntoIter = Iter<'a, u8>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl Display for RawStr[src]
impl Display for RawStrfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Debug for RawStr[src]
impl Debug for RawStrfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Borrow<RawStr> for RawString[src]
impl Borrow<RawStr> for RawStringimpl ToOwned for RawStr[src]
impl ToOwned for RawStrtype Owned = RawString
fn to_owned(&self) -> RawString[src]
fn to_owned(&self) -> RawStringCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut Self::Owned)[src]
fn clone_into(&self, target: &mut Self::Owned)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl AsRef<RawStr> for RawString[src]
impl AsRef<RawStr> for RawString