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 RawStr
pub fn from_bytes(bytes: &[u8]) -> &Self
[src]
pub fn from_bytes(bytes: &[u8]) -> &Self
pub fn from_str(bytes: &str) -> &Self
[src]
pub fn from_str(bytes: &str) -> &Self
pub 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 Self
pub 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) -> usize
Trait Implementations
impl PartialEq for RawStr
[src]
impl PartialEq for RawStr
fn eq(&self, other: &RawStr) -> bool
[src]
fn eq(&self, other: &RawStr) -> bool
This 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) -> bool
This method tests for !=
.
impl Eq for RawStr
[src]
impl Eq for RawStr
impl PartialOrd for RawStr
[src]
impl PartialOrd for RawStr
fn 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) -> bool
This 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) -> bool
This 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) -> bool
This 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) -> bool
This 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 RawStr
fn cmp(&self, other: &RawStr) -> Ordering
[src]
fn cmp(&self, other: &RawStr) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for RawStr
[src]
impl Hash for RawStr
fn 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 RawStr
impl AsRef<RawStr> for [u8]
[src]
impl AsRef<RawStr> for [u8]
impl AsRef<RawStr> for str
[src]
impl AsRef<RawStr> for str
impl AsRef<[u8]> for RawStr
[src]
impl AsRef<[u8]> for RawStr
impl<'a> Default for &'a RawStr
[src]
impl<'a> Default for &'a RawStr
impl<'a> Default for &'a mut RawStr
[src]
impl<'a> Default for &'a mut RawStr
impl Index<Range<usize>> for RawStr
[src]
impl Index<Range<usize>> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &RawStr
[src]
fn index(&self, index: Range<usize>) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<Range<usize>> for RawStr
[src]
impl IndexMut<Range<usize>> for RawStr
fn index_mut(&mut self, index: Range<usize>) -> &mut RawStr
[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for RawStr
[src]
impl Index<RangeFrom<usize>> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &RawStr
[src]
fn index(&self, index: RangeFrom<usize>) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<RangeFrom<usize>> for RawStr
[src]
impl IndexMut<RangeFrom<usize>> for RawStr
fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut RawStr
[src]
fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Index<RangeFull> for RawStr
[src]
impl Index<RangeFull> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeFull) -> &RawStr
[src]
fn index(&self, index: RangeFull) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<RangeFull> for RawStr
[src]
impl IndexMut<RangeFull> for RawStr
fn index_mut(&mut self, index: RangeFull) -> &mut RawStr
[src]
fn index_mut(&mut self, index: RangeFull) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Index<RangeInclusive<usize>> for RawStr
[src]
impl Index<RangeInclusive<usize>> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeInclusive<usize>) -> &RawStr
[src]
fn index(&self, index: RangeInclusive<usize>) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<RangeInclusive<usize>> for RawStr
[src]
impl IndexMut<RangeInclusive<usize>> for RawStr
fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut RawStr
[src]
fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for RawStr
[src]
impl Index<RangeTo<usize>> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &RawStr
[src]
fn index(&self, index: RangeTo<usize>) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<RangeTo<usize>> for RawStr
[src]
impl IndexMut<RangeTo<usize>> for RawStr
fn index_mut(&mut self, index: RangeTo<usize>) -> &mut RawStr
[src]
fn index_mut(&mut self, index: RangeTo<usize>) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Index<RangeToInclusive<usize>> for RawStr
[src]
impl Index<RangeToInclusive<usize>> for RawStr
type Output = RawStr
The returned type after indexing.
fn index(&self, index: RangeToInclusive<usize>) -> &RawStr
[src]
fn index(&self, index: RangeToInclusive<usize>) -> &RawStr
Performs the indexing (container[index]
) operation.
impl IndexMut<RangeToInclusive<usize>> for RawStr
[src]
impl IndexMut<RangeToInclusive<usize>> for RawStr
fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut RawStr
[src]
fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut RawStr
Performs the mutable indexing (container[index]
) operation.
impl Display for RawStr
[src]
impl Display for RawStr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Debug for RawStr
[src]
impl Debug for RawStr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Borrow<RawStr> for RawString
[src]
impl Borrow<RawStr> for RawString
impl ToOwned for RawStr
[src]
impl ToOwned for RawStr
type Owned = RawString
fn to_owned(&self) -> RawString
[src]
fn to_owned(&self) -> RawString
Creates 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