Struct raw_string::RawString [−][src]
pub struct RawString { /* fields omitted */ }
A String
with unchecked contents.
It is basically a Vec<u8>
, to be interpreted as string.
Unlike String
, there are no guarantees about the contents being valid UTF-8.
Unlike Vec<u8>
, its Display and Debug implementations show a string, not
an array of numbers.
Very similar to the Unix implementation of OsString
.
Methods
impl RawString
[src]
impl RawString
pub fn new() -> Self
[src]
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
[src]
pub fn with_capacity(capacity: usize) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
[src]
pub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_string(bytes: String) -> Self
[src]
pub fn from_string(bytes: String) -> Self
pub fn into_bytes(self) -> Vec<u8>
[src]
pub fn into_bytes(self) -> Vec<u8>
pub fn reserve(&mut self, additional: usize)
[src]
pub fn reserve(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
[src]
pub fn reserve_exact(&mut self, additional: usize)
pub fn shrink_to_fit(&mut self)
[src]
pub fn shrink_to_fit(&mut self)
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
pub fn into_boxed_raw_str(self) -> Box<RawStr>
[src]
pub fn into_boxed_raw_str(self) -> Box<RawStr>
pub fn push<T: AsRef<RawStr>>(&mut self, s: T)
[src]
pub fn push<T: AsRef<RawStr>>(&mut self, s: T)
pub fn as_mut_vec(&mut self) -> &mut Vec<u8>
[src]
pub fn as_mut_vec(&mut self) -> &mut Vec<u8>
Methods from Deref<Target = RawStr>
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
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 Default for RawString
[src]
impl Default for RawString
impl PartialEq for RawString
[src]
impl PartialEq for RawString
fn eq(&self, other: &RawString) -> bool
[src]
fn eq(&self, other: &RawString) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &RawString) -> bool
[src]
fn ne(&self, other: &RawString) -> bool
This method tests for !=
.
impl Eq for RawString
[src]
impl Eq for RawString
impl PartialOrd for RawString
[src]
impl PartialOrd for RawString
fn partial_cmp(&self, other: &RawString) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &RawString) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &RawString) -> bool
[src]
fn lt(&self, other: &RawString) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &RawString) -> bool
[src]
fn le(&self, other: &RawString) -> 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: &RawString) -> bool
[src]
fn gt(&self, other: &RawString) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &RawString) -> bool
[src]
fn ge(&self, other: &RawString) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for RawString
[src]
impl Ord for RawString
fn cmp(&self, other: &RawString) -> Ordering
[src]
fn cmp(&self, other: &RawString) -> 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 RawString
[src]
impl Hash for RawString
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 Deref for RawString
[src]
impl Deref for RawString
type Target = RawStr
The resulting type after dereferencing.
fn deref(&self) -> &RawStr
[src]
fn deref(&self) -> &RawStr
Dereferences the value.
impl DerefMut for RawString
[src]
impl DerefMut for RawString
impl Index<Range<usize>> for RawString
[src]
impl Index<Range<usize>> for RawString
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 RawString
[src]
impl IndexMut<Range<usize>> for RawString
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 RawString
[src]
impl Index<RangeFrom<usize>> for RawString
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 RawString
[src]
impl IndexMut<RangeFrom<usize>> for RawString
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 RawString
[src]
impl Index<RangeFull> for RawString
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 RawString
[src]
impl IndexMut<RangeFull> for RawString
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 RawString
[src]
impl Index<RangeInclusive<usize>> for RawString
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 RawString
[src]
impl IndexMut<RangeInclusive<usize>> for RawString
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 RawString
[src]
impl Index<RangeTo<usize>> for RawString
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 RawString
[src]
impl IndexMut<RangeTo<usize>> for RawString
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 RawString
[src]
impl Index<RangeToInclusive<usize>> for RawString
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 RawString
[src]
impl IndexMut<RangeToInclusive<usize>> for RawString
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 Borrow<RawStr> for RawString
[src]
impl Borrow<RawStr> for RawString
impl AsRef<RawStr> for RawString
[src]
impl AsRef<RawStr> for RawString
impl AsRef<[u8]> for RawString
[src]
impl AsRef<[u8]> for RawString
impl Display for RawString
[src]
impl Display for RawString
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 RawString
[src]
impl Debug for RawString