Struct widestring::utfstr::Utf16Str
source · pub struct Utf16Str { /* private fields */ }
Expand description
UTF-16 string slice for Utf16String
.
Utf16Str
is to Utf16String
as str
is to String
.
Utf16Str
slices are string slices that are always valid UTF-16 encoding. This is unlike
the U16Str
string slices, which may not have valid encoding. In this way,
Utf16Str
string slices most resemble native str
slices of all the types in this
crate.
§Examples
The easiest way to use Utf16Str
is with the utf16str!
macro to
convert string literals into string slices at compile time:
use widestring::utf16str;
let hello = utf16str!("Hello, world!");
You can also convert a u16
slice directly, provided it is valid UTF-16:
use widestring::Utf16Str;
let sparkle_heart = [0xd83d, 0xdc96];
let sparkle_heart = Utf16Str::from_slice(&sparkle_heart).unwrap();
assert_eq!("💖", sparkle_heart);
Implementations§
source§impl Utf16Str
impl Utf16Str
sourcepub const unsafe fn from_slice_unchecked(s: &[u16]) -> &Self
pub const unsafe fn from_slice_unchecked(s: &[u16]) -> &Self
Converts a slice to a string slice without checking that the string contains valid UTF-16.
See the safe version, from_slice
, for more information.
§Safety
This function is unsafe because it does not check that the slice passed to it is valid
UTF-16. If this constraint is violated, undefined behavior results as it is assumed the
Utf16Str
is always valid UTF-16.
§Examples
use widestring::Utf16Str;
let sparkle_heart = vec![0xd83d, 0xdc96]; // Raw surrogate pair
let sparkle_heart = unsafe { Utf16Str::from_slice_unchecked(&sparkle_heart) };
assert_eq!("💖", sparkle_heart);
sourcepub unsafe fn from_slice_unchecked_mut(s: &mut [u16]) -> &mut Self
pub unsafe fn from_slice_unchecked_mut(s: &mut [u16]) -> &mut Self
Converts a mutable slice to a mutable string slice without checking that the string contains valid UTF-16.
See the safe version, from_slice_mut
, for more information.
§Safety
This function is unsafe because it does not check that the slice passed to it is valid
UTF-16. If this constraint is violated, undefined behavior results as it is assumed the
Utf16Str
is always valid UTF-16.
§Examples
use widestring::Utf16Str;
let mut sparkle_heart = vec![0xd83d, 0xdc96]; // Raw surrogate pair
let sparkle_heart = unsafe { Utf16Str::from_slice_unchecked_mut(&mut sparkle_heart) };
assert_eq!("💖", sparkle_heart);
sourcepub unsafe fn from_boxed_slice_unchecked(s: Box<[u16]>) -> Box<Self>
pub unsafe fn from_boxed_slice_unchecked(s: Box<[u16]>) -> Box<Self>
sourcepub unsafe fn get_unchecked<I>(&self, index: I) -> &Self
pub unsafe fn get_unchecked<I>(&self, index: I) -> &Self
Returns an unchecked subslice of this string slice.
This is the unchecked alternative to indexing the string slice.
§Safety
Callers of this function are responsible that these preconditions are satisfied:
- The starting index must not exceed the ending index;
- Indexes must be within bounds of the original slice;
- Indexes must lie on UTF-16 sequence boundaries.
Failing that, the returned string slice may reference invalid memory or violate the invariants communicated by the type.
§Examples
let v = utf16str!("⚧️🏳️⚧️➡️s");
unsafe {
assert_eq!(utf16str!("⚧️"), v.get_unchecked(..2));
assert_eq!(utf16str!("🏳️⚧️"), v.get_unchecked(2..8));
assert_eq!(utf16str!("➡️"), v.get_unchecked(8..10));
assert_eq!(utf16str!("s"), v.get_unchecked(10..));
}
sourcepub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut Self
pub unsafe fn get_unchecked_mut<I>(&mut self, index: I) -> &mut Self
Returns a mutable, unchecked subslice of this string slice
This is the unchecked alternative to indexing the string slice.
§Safety
Callers of this function are responsible that these preconditions are satisfied:
- The starting index must not exceed the ending index;
- Indexes must be within bounds of the original slice;
- Indexes must lie on UTF-16 sequence boundaries.
Failing that, the returned string slice may reference invalid memory or violate the invariants communicated by the type.
§Examples
let mut v = utf16str!("⚧️🏳️⚧️➡️s").to_owned();
unsafe {
assert_eq!(utf16str!("⚧️"), v.get_unchecked_mut(..2));
assert_eq!(utf16str!("🏳️⚧️"), v.get_unchecked_mut(2..8));
assert_eq!(utf16str!("➡️"), v.get_unchecked_mut(8..10));
assert_eq!(utf16str!("s"), v.get_unchecked_mut(10..));
}
sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Returns the length of self
.
This length is in u16
values, not char
s or graphemes. In other words, it may not be
what human considers the length of the string.
§Examples
assert_eq!(utf16str!("foo").len(), 3);
let complex = utf16str!("⚧️🏳️⚧️➡️s");
assert_eq!(complex.len(), 11);
assert_eq!(complex.chars().count(), 10);
sourcepub const fn as_slice(&self) -> &[u16]
pub const fn as_slice(&self) -> &[u16]
Converts a string to a slice of its underlying elements.
To convert the slice back into a string slice, use the
from_slice
function.
sourcepub unsafe fn as_mut_slice(&mut self) -> &mut [u16]
pub unsafe fn as_mut_slice(&mut self) -> &mut [u16]
Converts a mutable string to a mutable slice of its underlying elements.
§Safety
This function is unsafe because you can violate the invariants of this type when mutating the slice. The caller must ensure that the contents of the slice is valid UTF before the borrow ends and the underlying string is used.
Use of this string type whose contents have been mutated to invalid UTF is undefined behavior.
sourcepub const fn as_ptr(&self) -> *const u16
pub const fn as_ptr(&self) -> *const u16
Converts a string slice to a raw pointer.
This pointer will be pointing to the first element of the string slice.
The caller must ensure that the returned pointer is never written to. If you need to
mutate the contents of the string slice, use as_mut_ptr
.
sourcepub fn as_mut_ptr(&mut self) -> *mut u16
pub fn as_mut_ptr(&mut self) -> *mut u16
Converts a mutable string slice to a mutable pointer.
This pointer will be pointing to the first element of the string slice.
sourcepub const fn as_ustr(&self) -> &U16Str
pub const fn as_ustr(&self) -> &U16Str
Returns this string as a wide string slice of undefined encoding.
sourcepub fn trim(&self) -> &Self
pub fn trim(&self) -> &Self
Returns a string slice with leading and trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property
White_Space
.
sourcepub fn trim_start(&self) -> &Self
pub fn trim_start(&self) -> &Self
Returns a string slice with leading whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property
White_Space
.
§Text directionality
A string is a sequence of elements. start
in this context means the first position
of that sequence; for a left-to-right language like English or Russian, this will be
left side, and for right-to-left languages like Arabic or Hebrew, this will be the
right side.
sourcepub fn trim_end(&self) -> &Self
pub fn trim_end(&self) -> &Self
Returns a string slice with trailing whitespace removed.
‘Whitespace’ is defined according to the terms of the Unicode Derived Core Property
White_Space
.
§Text directionality
A string is a sequence of elements. end
in this context means the last position of
that sequence; for a left-to-right language like English or Russian, this will be
right side, and for right-to-left languages like Arabic or Hebrew, this will be the
left side.
sourcepub fn into_boxed_slice(self: Box<Self>) -> Box<[u16]>
pub fn into_boxed_slice(self: Box<Self>) -> Box<[u16]>
Converts a boxed string into a boxed slice without copying or allocating.
sourcepub fn into_utfstring(self: Box<Self>) -> Utf16String
pub fn into_utfstring(self: Box<Self>) -> Utf16String
Converts a boxed string slice into an owned UTF string without copying or allocating.
sourcepub fn repeat(&self, n: usize) -> Utf16String
pub fn repeat(&self, n: usize) -> Utf16String
Creates a new owned string by repeating this string n
times.
§Panics
This function will panic if the capacity would overflow.
source§impl Utf16Str
impl Utf16Str
sourcepub fn from_slice(s: &[u16]) -> Result<&Self, Utf16Error>
pub fn from_slice(s: &[u16]) -> Result<&Self, Utf16Error>
Converts a slice of UTF-16 data to a string slice.
Not all slices of u16
values are valid to convert, since Utf16Str
requires that it
is always valid UTF-16. This function checks to ensure that the values are valid UTF-16, and
then does the conversion.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_slice_unchecked
, which has the same behavior but skips
the check.
If you need an owned string, consider using Utf16String::from_vec
instead.
Because you can stack-allocate a [u16; N]
, this function is one way to have a
stack-allocated string. Indeed, the utf16str!
macro does exactly this
after converting from UTF-8 to UTF-16.
§Errors
Returns an error if the slice is not UTF-16 with a description as to why the provided slice is not UTF-16.
§Examples
use widestring::Utf16Str;
let sparkle_heart = vec![0xd83d, 0xdc96]; // Raw surrogate pair
let sparkle_heart = Utf16Str::from_slice(&sparkle_heart).unwrap();
assert_eq!("💖", sparkle_heart);
With incorrect values that return an error:
use widestring::Utf16Str;
let sparkle_heart = vec![0xd83d, 0x0]; // This is an invalid unpaired surrogate
assert!(Utf16Str::from_slice(&sparkle_heart).is_err());
sourcepub fn from_slice_mut(s: &mut [u16]) -> Result<&mut Self, Utf16Error>
pub fn from_slice_mut(s: &mut [u16]) -> Result<&mut Self, Utf16Error>
Converts a mutable slice of UTF-16 data to a mutable string slice.
Not all slices of u16
values are valid to convert, since Utf16Str
requires that it
is always valid UTF-16. This function checks to ensure that the values are valid UTF-16, and
then does the conversion.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_slice_unchecked_mut
, which has the same behavior
but skips the check.
If you need an owned string, consider using Utf16String::from_vec
instead.
Because you can stack-allocate a [u16; N]
, this function is one way to have a
stack-allocated string. Indeed, the utf16str!
macro does exactly this
after converting from UTF-8 to UTF-16.
§Errors
Returns an error if the slice is not UTF-16 with a description as to why the provided slice is not UTF-16.
§Examples
use widestring::Utf16Str;
let mut sparkle_heart = vec![0xd83d, 0xdc96]; // Raw surrogate pair
let sparkle_heart = Utf16Str::from_slice_mut(&mut sparkle_heart).unwrap();
assert_eq!("💖", sparkle_heart);
With incorrect values that return an error:
use widestring::Utf16Str;
let mut sparkle_heart = vec![0xd83d, 0x0]; // This is an invalid unpaired surrogate
assert!(Utf16Str::from_slice_mut(&mut sparkle_heart).is_err());
sourcepub const unsafe fn from_ustr_unchecked(s: &U16Str) -> &Self
pub const unsafe fn from_ustr_unchecked(s: &U16Str) -> &Self
Converts a wide string slice of undefined encoding to a UTF-16 string slice without checking if the string slice is valid UTF-16.
See the safe version, from_ustr
, for more information.
§Safety
This function is unsafe because it does not check that the string slice passed to it is
valid UTF-16. If this constraint is violated, undefined behavior results as it is assumed
the Utf16Str
is always valid UTF-16.
§Examples
use widestring::{Utf16Str, u16str};
let sparkle_heart = u16str!("💖");
let sparkle_heart = unsafe { Utf16Str::from_ustr_unchecked(sparkle_heart) };
assert_eq!("💖", sparkle_heart);
sourcepub unsafe fn from_ustr_unchecked_mut(s: &mut U16Str) -> &mut Self
pub unsafe fn from_ustr_unchecked_mut(s: &mut U16Str) -> &mut Self
Converts a mutable wide string slice of undefined encoding to a mutable UTF-16 string slice without checking if the string slice is valid UTF-16.
See the safe version, from_ustr_mut
, for more information.
§Safety
This function is unsafe because it does not check that the string slice passed to it is
valid UTF-16. If this constraint is violated, undefined behavior results as it is assumed
the Utf16Str
is always valid UTF-16.
sourcepub fn from_ustr(s: &U16Str) -> Result<&Self, Utf16Error>
pub fn from_ustr(s: &U16Str) -> Result<&Self, Utf16Error>
Converts a wide string slice of undefined encoding to a UTF-16 string slice.
Since U16Str
does not have a specified encoding, this conversion may fail if the
U16Str
does not contain valid UTF-16 data.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_ustr_unchecked
, which has the same behavior
but skips the check.
§Errors
Returns an error if the string slice is not UTF-16 with a description as to why the provided string slice is not UTF-16.
§Examples
use widestring::{Utf16Str, u16str};
let sparkle_heart = u16str!("💖");
let sparkle_heart = Utf16Str::from_ustr(sparkle_heart).unwrap();
assert_eq!("💖", sparkle_heart);
sourcepub fn from_ustr_mut(s: &mut U16Str) -> Result<&mut Self, Utf16Error>
pub fn from_ustr_mut(s: &mut U16Str) -> Result<&mut Self, Utf16Error>
Converts a mutable wide string slice of undefined encoding to a mutable UTF-16 string slice.
Since U16Str
does not have a specified encoding, this conversion may fail if the
U16Str
does not contain valid UTF-16 data.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_ustr_unchecked_mut
, which has the same behavior
but skips the check.
§Errors
Returns an error if the string slice is not UTF-16 with a description as to why the provided string slice is not UTF-16.
sourcepub unsafe fn from_ucstr_unchecked(s: &U16CStr) -> &Self
pub unsafe fn from_ucstr_unchecked(s: &U16CStr) -> &Self
Converts a wide C string slice to a UTF-16 string slice without checking if the string slice is valid UTF-16.
The resulting string slice does not contain the nul terminator.
See the safe version, from_ucstr
, for more information.
§Safety
This function is unsafe because it does not check that the string slice passed to it is
valid UTF-16. If this constraint is violated, undefined behavior results as it is assumed
the Utf16Str
is always valid UTF-16.
§Examples
use widestring::{Utf16Str, u16cstr};
let sparkle_heart = u16cstr!("💖");
let sparkle_heart = unsafe { Utf16Str::from_ucstr_unchecked(sparkle_heart) };
assert_eq!("💖", sparkle_heart);
sourcepub unsafe fn from_ucstr_unchecked_mut(s: &mut U16CStr) -> &mut Self
pub unsafe fn from_ucstr_unchecked_mut(s: &mut U16CStr) -> &mut Self
Converts a mutable wide C string slice to a mutable UTF-16 string slice without checking if the string slice is valid UTF-16.
The resulting string slice does not contain the nul terminator.
See the safe version, from_ucstr_mut
, for more information.
§Safety
This function is unsafe because it does not check that the string slice passed to it is
valid UTF-16. If this constraint is violated, undefined behavior results as it is assumed
the Utf16Str
is always valid UTF-16.
sourcepub fn from_ucstr(s: &U16CStr) -> Result<&Self, Utf16Error>
pub fn from_ucstr(s: &U16CStr) -> Result<&Self, Utf16Error>
Converts a wide C string slice to a UTF-16 string slice.
The resulting string slice does not contain the nul terminator.
Since U16CStr
does not have a specified encoding, this conversion may
fail if the U16CStr
does not contain valid UTF-16 data.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_ucstr_unchecked
, which has the same behavior
but skips the check.
§Errors
Returns an error if the string slice is not UTF-16 with a description as to why the provided string slice is not UTF-16.
§Examples
use widestring::{Utf16Str, u16cstr};
let sparkle_heart = u16cstr!("💖");
let sparkle_heart = Utf16Str::from_ucstr(sparkle_heart).unwrap();
assert_eq!("💖", sparkle_heart);
sourcepub unsafe fn from_ucstr_mut(s: &mut U16CStr) -> Result<&mut Self, Utf16Error>
pub unsafe fn from_ucstr_mut(s: &mut U16CStr) -> Result<&mut Self, Utf16Error>
Converts a mutable wide C string slice to a mutable UTF-16 string slice.
The resulting string slice does not contain the nul terminator.
Since U16CStr
does not have a specified encoding, this conversion may
fail if the U16CStr
does not contain valid UTF-16 data.
If you are sure that the slice is valid UTF-16, and you don’t want to incur the overhead of
the validity check, there is an unsafe version of this function,
from_ucstr_unchecked_mut
, which has the same behavior
but skips the check.
§Safety
This method is unsafe because you can violate the invariants of U16CStr
when mutating the slice (i.e. by adding interior nul values).
§Errors
Returns an error if the string slice is not UTF-16 with a description as to why the provided string slice is not UTF-16.
sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Converts to a standard UTF-8 String
.
Because this string is always valid UTF-16, the conversion is lossless and non-fallible.
sourcepub const fn is_char_boundary(&self, index: usize) -> bool
pub const fn is_char_boundary(&self, index: usize) -> bool
Checks that index
-th value is the value in a UTF-16 code point sequence or the end of the
string.
Returns true
if the value at index
is not a UTF-16 surrogate value, or if the value at
index
is the first value of a surrogate pair (the “high” surrogate). Returns false
if
the value at index
is the second value of a surrogate pair (a.k.a the “low” surrogate).
The start and end of the string (when index == self.len()
) are considered to be
boundaries.
Returns false
if index is greater than
self.len()`.
§Examples
let s = utf16str!("Sparkle 💖 Heart");
assert!(s.is_char_boundary(0));
// high surrogate of `💖`
assert!(s.is_char_boundary(8));
// low surrogate of `💖`
assert!(!s.is_char_boundary(9));
assert!(s.is_char_boundary(s.len()));
sourcepub fn get<I>(&self, index: I) -> Option<&Self>
pub fn get<I>(&self, index: I) -> Option<&Self>
Returns a subslice of this string.
This is the non-panicking alternative to indexing the string. Returns None
whenever
equivalent indexing operation would panic.
§Examples
let v = utf16str!("⚧️🏳️⚧️➡️s");
assert_eq!(Some(utf16str!("⚧️")), v.get(..2));
assert_eq!(Some(utf16str!("🏳️⚧️")), v.get(2..8));
assert_eq!(Some(utf16str!("➡️")), v.get(8..10));
assert_eq!(Some(utf16str!("s")), v.get(10..));
assert!(v.get(3..4).is_none());
sourcepub fn get_mut<I>(&mut self, index: I) -> Option<&mut Self>
pub fn get_mut<I>(&mut self, index: I) -> Option<&mut Self>
Returns a mutable subslice of this string.
This is the non-panicking alternative to indexing the string. Returns None
whenever
equivalent indexing operation would panic.
§Examples
let mut v = utf16str!("⚧️🏳️⚧️➡️s").to_owned();
assert_eq!(utf16str!("⚧️"), v.get_mut(..2).unwrap());
assert_eq!(utf16str!("🏳️⚧️"), v.get_mut(2..8).unwrap());
assert_eq!(utf16str!("➡️"), v.get_mut(8..10).unwrap());
assert_eq!(utf16str!("s"), v.get_mut(10..).unwrap());
assert!(v.get_mut(3..4).is_none());
sourcepub fn split_at(&self, mid: usize) -> (&Self, &Self)
pub fn split_at(&self, mid: usize) -> (&Self, &Self)
Divide one string slice into two at an index.
The argument, mid
, should be an offset from the start of the string. It must also be on
the boundary of a UTF-16 code point.
The two slices returned go from the start of the string slice to mid
, and from mid
to
the end of the string slice.
To get mutable string slices instead, see the split_at_mut
method.
§Panics
Panics if mid
is not on a UTF-16 code point boundary, or if it is past the end of the last
code point of the string slice.
§Examples
let s = utf16str!("Per Martin-Löf");
let (first, last) = s.split_at(3);
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
sourcepub fn split_at_mut(&mut self, mid: usize) -> (&mut Self, &mut Self)
pub fn split_at_mut(&mut self, mid: usize) -> (&mut Self, &mut Self)
Divide one mutable string slice into two at an index.
The argument, mid
, should be an offset from the start of the string. It must also be on
the boundary of a UTF-16 code point.
The two slices returned go from the start of the string slice to mid
, and from mid
to
the end of the string slice.
To get immutable string slices instead, see the split_at
method.
§Panics
Panics if mid
is not on a UTF-16 code point boundary, or if it is past the end of the last
code point of the string slice.
§Examples
let mut s = utf16str!("Per Martin-Löf").to_owned();
let (first, last) = s.split_at_mut(3);
assert_eq!("Per", first);
assert_eq!(" Martin-Löf", last);
sourcepub fn chars(&self) -> CharsUtf16<'_> ⓘ
pub fn chars(&self) -> CharsUtf16<'_> ⓘ
Returns an iterator over the char
s of a string slice.
As this string slice consists of valid UTF-16, we can iterate through a string slice by
char
. This method returns such an iterator.
It’s important to remember that char
represents a Unicode Scalar Value, and might not
match your idea of what a ‘character’ is. Iteration over grapheme clusters may be what you
actually want. This functionality is not provided by this crate.
sourcepub fn char_indices(&self) -> CharIndicesUtf16<'_> ⓘ
pub fn char_indices(&self) -> CharIndicesUtf16<'_> ⓘ
Returns an iterator over the char
s of a string slice and their positions.
As this string slice consists of valid UTF-16, we can iterate through a string slice by
char
. This method returns an iterator of both these char
s as well as their offsets.
The iterator yields tuples. The position is first, the char
is second.
sourcepub fn code_units(&self) -> CodeUnits<'_> ⓘ
pub fn code_units(&self) -> CodeUnits<'_> ⓘ
sourcepub fn encode_utf8(&self) -> EncodeUtf8<CharsUtf16<'_>> ⓘ
pub fn encode_utf8(&self) -> EncodeUtf8<CharsUtf16<'_>> ⓘ
Returns an iterator of bytes over the string encoded as UTF-8.
sourcepub fn encode_utf32(&self) -> EncodeUtf32<CharsUtf16<'_>> ⓘ
pub fn encode_utf32(&self) -> EncodeUtf32<CharsUtf16<'_>> ⓘ
Returns an iterator of u32
over the sting encoded as UTF-32.
sourcepub fn escape_debug(&self) -> EscapeDebug<CharsUtf16<'_>> ⓘ
pub fn escape_debug(&self) -> EscapeDebug<CharsUtf16<'_>> ⓘ
Returns an iterator that escapes each char
in self
with char::escape_debug
.
sourcepub fn escape_default(&self) -> EscapeDefault<CharsUtf16<'_>> ⓘ
pub fn escape_default(&self) -> EscapeDefault<CharsUtf16<'_>> ⓘ
Returns an iterator that escapes each char
in self
with char::escape_default
.
sourcepub fn escape_unicode(&self) -> EscapeUnicode<CharsUtf16<'_>> ⓘ
pub fn escape_unicode(&self) -> EscapeUnicode<CharsUtf16<'_>> ⓘ
Returns an iterator that escapes each char
in self
with char::escape_unicode
.
sourcepub fn to_lowercase(&self) -> Utf16String
pub fn to_lowercase(&self) -> Utf16String
Returns the lowercase equivalent of this string slice, as a new Utf16String
.
‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property
Lowercase
.
Since some characters can expand into multiple characters when changing the case, this
function returns a Utf16String
instead of modifying the parameter in-place.
sourcepub fn to_uppercase(&self) -> Utf16String
pub fn to_uppercase(&self) -> Utf16String
Returns the uppercase equivalent of this string slice, as a new Utf16String
.
‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property
Uppercase
.
Since some characters can expand into multiple characters when changing the case, this
function returns a Utf16String
instead of modifying the parameter in-place.
Trait Implementations§
source§impl Add<&Utf16Str> for Utf16String
impl Add<&Utf16Str> for Utf16String
source§impl AddAssign<&Utf16Str> for U16String
impl AddAssign<&Utf16Str> for U16String
source§fn add_assign(&mut self, rhs: &Utf16Str)
fn add_assign(&mut self, rhs: &Utf16Str)
+=
operation. Read moresource§impl AddAssign<&Utf16Str> for Utf16String
impl AddAssign<&Utf16Str> for Utf16String
source§fn add_assign(&mut self, rhs: &Utf16Str)
fn add_assign(&mut self, rhs: &Utf16Str)
+=
operation. Read moresource§impl AsMut<Utf16Str> for Utf16String
impl AsMut<Utf16Str> for Utf16String
source§impl AsRef<Utf16Str> for Utf16String
impl AsRef<Utf16Str> for Utf16String
source§impl Borrow<Utf16Str> for Utf16String
impl Borrow<Utf16Str> for Utf16String
source§impl BorrowMut<Utf16Str> for Utf16String
impl BorrowMut<Utf16Str> for Utf16String
source§fn borrow_mut(&mut self) -> &mut Utf16Str
fn borrow_mut(&mut self) -> &mut Utf16Str
source§impl<'a> Extend<&'a Utf16Str> for U16String
impl<'a> Extend<&'a Utf16Str> for U16String
source§fn extend<T: IntoIterator<Item = &'a Utf16Str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a Utf16Str>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl<'a> Extend<&'a Utf16Str> for Utf16String
impl<'a> Extend<&'a Utf16Str> for Utf16String
source§fn extend<T: IntoIterator<Item = &'a Utf16Str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a Utf16Str>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl From<&Utf16Str> for Utf16String
impl From<&Utf16Str> for Utf16String
source§impl From<&mut Utf16Str> for Utf16String
impl From<&mut Utf16Str> for Utf16String
source§impl<'a> FromIterator<&'a Utf16Str> for U16String
impl<'a> FromIterator<&'a Utf16Str> for U16String
source§impl<'a> FromIterator<&'a Utf16Str> for Utf16String
impl<'a> FromIterator<&'a Utf16Str> for Utf16String
source§impl<'a, 'b> PartialEq<&'a Utf16Str> for Cow<'b, Utf16Str>
impl<'a, 'b> PartialEq<&'a Utf16Str> for Cow<'b, Utf16Str>
source§impl<'a, 'b> PartialEq<&'a Utf16Str> for Cow<'b, str>
impl<'a, 'b> PartialEq<&'a Utf16Str> for Cow<'b, str>
source§impl PartialEq<&Utf16Str> for Utf16String
impl PartialEq<&Utf16Str> for Utf16String
source§impl PartialEq<&Utf16Str> for Utf32Str
impl PartialEq<&Utf16Str> for Utf32Str
source§impl PartialEq<&Utf16Str> for Utf32String
impl PartialEq<&Utf16Str> for Utf32String
source§impl PartialEq<&Utf32Str> for Utf16Str
impl PartialEq<&Utf32Str> for Utf16Str
source§impl PartialEq<&str> for Utf16Str
impl PartialEq<&str> for Utf16Str
source§impl<'a, 'b> PartialEq<Cow<'a, Utf16Str>> for &'b Utf16Str
impl<'a, 'b> PartialEq<Cow<'a, Utf16Str>> for &'b Utf16Str
source§impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b Utf16Str
impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b Utf16Str
source§impl PartialEq<String> for Utf16Str
impl PartialEq<String> for Utf16Str
source§impl PartialEq<U16CStr> for Utf16Str
impl PartialEq<U16CStr> for Utf16Str
source§impl PartialEq<U16CString> for Utf16Str
impl PartialEq<U16CString> for Utf16Str
source§fn eq(&self, other: &U16CString) -> bool
fn eq(&self, other: &U16CString) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<U16Str> for Utf16Str
impl PartialEq<U16Str> for Utf16Str
source§impl PartialEq<U16String> for Utf16Str
impl PartialEq<U16String> for Utf16Str
source§impl PartialEq<Utf16Str> for &Utf16Str
impl PartialEq<Utf16Str> for &Utf16Str
source§impl PartialEq<Utf16Str> for &Utf32Str
impl PartialEq<Utf16Str> for &Utf32Str
source§impl PartialEq<Utf16Str> for &str
impl PartialEq<Utf16Str> for &str
source§impl PartialEq<Utf16Str> for Cow<'_, Utf16Str>
impl PartialEq<Utf16Str> for Cow<'_, Utf16Str>
source§impl PartialEq<Utf16Str> for Cow<'_, str>
impl PartialEq<Utf16Str> for Cow<'_, str>
source§impl PartialEq<Utf16Str> for String
impl PartialEq<Utf16Str> for String
source§impl PartialEq<Utf16Str> for U16CStr
impl PartialEq<Utf16Str> for U16CStr
source§impl PartialEq<Utf16Str> for U16CString
impl PartialEq<Utf16Str> for U16CString
source§impl PartialEq<Utf16Str> for U16Str
impl PartialEq<Utf16Str> for U16Str
source§impl PartialEq<Utf16Str> for U16String
impl PartialEq<Utf16Str> for U16String
source§impl PartialEq<Utf16Str> for Utf16String
impl PartialEq<Utf16Str> for Utf16String
source§impl PartialEq<Utf16Str> for Utf32Str
impl PartialEq<Utf16Str> for Utf32Str
source§impl PartialEq<Utf16Str> for str
impl PartialEq<Utf16Str> for str
source§impl PartialEq<Utf16String> for &Utf16Str
impl PartialEq<Utf16String> for &Utf16Str
source§fn eq(&self, other: &Utf16String) -> bool
fn eq(&self, other: &Utf16String) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Utf16String> for Utf16Str
impl PartialEq<Utf16String> for Utf16Str
source§fn eq(&self, other: &Utf16String) -> bool
fn eq(&self, other: &Utf16String) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Utf32Str> for &Utf16Str
impl PartialEq<Utf32Str> for &Utf16Str
source§impl PartialEq<Utf32Str> for Utf16Str
impl PartialEq<Utf32Str> for Utf16Str
source§impl PartialEq<Utf32String> for &Utf16Str
impl PartialEq<Utf32String> for &Utf16Str
source§fn eq(&self, other: &Utf32String) -> bool
fn eq(&self, other: &Utf32String) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for Utf16Str
impl PartialEq for Utf16Str
source§impl PartialOrd for Utf16Str
impl PartialOrd for Utf16Str
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more