Struct raw_string::RawString
source ·
[−]pub struct RawString { /* private fields */ }Expand description
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.
Implementations
pub fn replace_range<R: RangeBounds<usize>, T: AsRef<RawStr>>(
&mut self,
range: R,
replace_with: T
)
Convert to an OsString.
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::RawStringExt::into_osstring.
Convert to a PathBuf.
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::RawStringExt::into_pathbuf.
Methods from Deref<Target = RawStr>
pub fn as_bytes_mut(&mut self) -> &mut [u8]ⓘ
pub fn utf8_chunks(&self) -> Utf8ChunksIter<'_>ⓘNotable traits for Utf8ChunksIter<'a>impl<'a> Iterator for Utf8ChunksIter<'a> type Item = Utf8Chunk<'a>;
pub fn utf8_chunks(&self) -> Utf8ChunksIter<'_>ⓘNotable traits for Utf8ChunksIter<'a>impl<'a> Iterator for Utf8ChunksIter<'a> type Item = Utf8Chunk<'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.
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.
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.
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Conversions only available on unix.
Auto Trait Implementations
impl RefUnwindSafe for RawString
impl UnwindSafe for RawString
Blanket Implementations
Mutably borrows from an owned value. Read more
