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 RawStringpub fn new() -> Self[src]
pub fn new() -> Selfpub fn with_capacity(capacity: usize) -> Self[src]
pub fn with_capacity(capacity: usize) -> Selfpub fn from_bytes(bytes: Vec<u8>) -> Self[src]
pub fn from_bytes(bytes: Vec<u8>) -> Selfpub fn from_string(bytes: String) -> Self[src]
pub fn from_string(bytes: String) -> Selfpub 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(&mut self, b: u8)[src]
pub fn push(&mut self, b: u8)pub fn push_str<T: AsRef<RawStr>>(&mut self, s: T)[src]
pub fn push_str<T: AsRef<RawStr>>(&mut self, s: T)pub fn as_mut_bytes(&mut self) -> &mut Vec<u8>[src]
pub fn as_mut_bytes(&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) -> usizepub fn iter(&self) -> Iter<u8>[src]
pub fn iter(&self) -> Iter<u8>Trait Implementations
impl Default for RawString[src]
impl Default for RawStringimpl PartialEq for RawString[src]
impl PartialEq for RawStringfn eq(&self, other: &RawString) -> bool[src]
fn eq(&self, other: &RawString) -> boolThis 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) -> boolThis method tests for !=.
impl Eq for RawString[src]
impl Eq for RawStringimpl PartialOrd for RawString[src]
impl PartialOrd for RawStringfn 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) -> boolThis 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) -> boolThis 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) -> boolThis 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) -> boolThis 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 RawStringfn cmp(&self, other: &RawString) -> Ordering[src]
fn cmp(&self, other: &RawString) -> 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 RawString[src]
impl Hash for RawStringfn 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 RawStringtype Target = RawStr
The resulting type after dereferencing.
fn deref(&self) -> &RawStr[src]
fn deref(&self) -> &RawStrDereferences the value.
impl DerefMut for RawString[src]
impl DerefMut for RawStringimpl Index<Range<usize>> for RawString[src]
impl Index<Range<usize>> for RawStringtype 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 RawString[src]
impl IndexMut<Range<usize>> for RawStringfn 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 RawString[src]
impl Index<RangeFrom<usize>> for RawStringtype 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 RawString[src]
impl IndexMut<RangeFrom<usize>> for RawStringfn 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 RawString[src]
impl Index<RangeFull> for RawStringtype 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 RawString[src]
impl IndexMut<RangeFull> for RawStringfn 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 RawString[src]
impl Index<RangeInclusive<usize>> for RawStringtype 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 RawString[src]
impl IndexMut<RangeInclusive<usize>> for RawStringfn 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 RawString[src]
impl Index<RangeTo<usize>> for RawStringtype 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 RawString[src]
impl IndexMut<RangeTo<usize>> for RawStringfn 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 RawString[src]
impl Index<RangeToInclusive<usize>> for RawStringtype 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 RawString[src]
impl IndexMut<RangeToInclusive<usize>> for RawStringfn 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 Borrow<RawStr> for RawString[src]
impl Borrow<RawStr> for RawStringimpl AsRef<RawStr> for RawString[src]
impl AsRef<RawStr> for RawStringimpl AsRef<[u8]> for RawString[src]
impl AsRef<[u8]> for RawStringimpl Display for RawString[src]
impl Display for RawStringfn 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 RawString[src]
impl Debug for RawString