widestring::ucstring

Type Alias WideCString

Source
pub type WideCString = U32CString;
Expand description

Alias for U16String or U32String depending on platform. Intended to match typical C wchar_t size on platform.

Aliased Type§

struct WideCString { /* private fields */ }

Implementations

Source§

impl U32CString

Source

pub fn from_chars(v: impl Into<Vec<char>>) -> Result<Self, ContainsNul<u32>>

Constructs a U32CString from a container of character data, checking for invalid nul values.

This method will consume the provided data and use the underlying elements to construct a new string. The data will be scanned for invalid nul values anywhere except the last character. The resulting string will always be nul-terminated even if the original string is not.

§Errors

This function will return an error if the data contains a nul value anywhere except the last character. The returned error will contain the Vec<u32> as well as the position of the nul value.

§Examples
use widestring::U32CString;
let v: Vec<char> = "Test".chars().collect();
// Create a wide string from the vector
let wcstr = U32CString::from_chars(v).unwrap();

The following example demonstrates errors from nul values in a vector.

use widestring::U32CString;
let v: Vec<char> = "T\u{0}est".chars().collect();
// Create a wide string from the vector
let res = U32CString::from_chars(v);
assert!(res.is_err());
assert_eq!(res.err().unwrap().nul_position(), 1);
Source

pub fn from_chars_truncate(v: impl Into<Vec<char>>) -> Self

Constructs a U32CString from a container of character data, truncating at the first nul value.

This method will consume the provided data and use the underlying elements to construct a new string. The string will be truncated at the first nul value in the string. The resulting string will always be nul-terminated even if the original string is not.

§Examples
use widestring::U32CString;
let v: Vec<char> = "Test\u{0}".chars().collect();
// Create a wide string from the vector
let wcstr = U32CString::from_chars_truncate(v);
Source

pub unsafe fn from_chars_unchecked(v: impl Into<Vec<char>>) -> Self

Constructs a U32CString from character data without checking for nul values.

A terminating nul value will be appended if the vector does not already have a terminating nul.

§Safety

This method is equivalent to from_chars except that no runtime assertion is made that v contains no interior nul values. Providing a vector with nul values anywhere but the last character will result in an invalid U32CString.

Source

pub fn from_str(s: impl AsRef<str>) -> Result<Self, ContainsNul<u32>>

Constructs a U32CString copy from a str, encoding it as UTF-32 and checking for invalid interior nul values.

This makes a string copy of the str. Since str will always be valid UTF-8, the resulting U32CString will also be valid UTF-32.

The string will be scanned for nul values, which are invalid anywhere except the last character. The resulting string will always be nul-terminated even if the original string is not.

§Errors

This function will return an error if the data contains a nul value anywhere except the last character. The returned error will contain a Vec<u32> as well as the position of the nul value.

§Examples
use widestring::U32CString;
let s = "MyString";
// Create a wide string from the string
let wcstr = U32CString::from_str(s).unwrap();

The following example demonstrates errors from nul values in a string.

use widestring::U32CString;
let s = "My\u{0}String";
// Create a wide string from the string
let res = U32CString::from_str(s);
assert!(res.is_err());
assert_eq!(res.err().unwrap().nul_position(), 2);
Source

pub unsafe fn from_str_unchecked(s: impl AsRef<str>) -> Self

Constructs a U32CString copy from a str, encoding it as UTF-32, without checking for nul values.

This makes a string copy of the str. Since str will always be valid UTF-8, the resulting U32CString will also be valid UTF-32.

The resulting string will always be nul-terminated even if the original string is not.

§Safety

This method is equivalent to from_str except that no runtime assertion is made that s contains invalid nul values. Providing a string with nul values anywhere except the last character will result in an invalid U32CString.

§Examples
use widestring::U32CString;
let s = "MyString";
// Create a wide string from the string
let wcstr = unsafe { U32CString::from_str_unchecked(s) };
Source

pub fn from_str_truncate(s: impl AsRef<str>) -> Self

Constructs a U32CString copy from a str, encoding it as UTF-32, truncating at the first nul terminator.

This makes a string copy of the str. Since str will always be valid UTF-8, the resulting U32CString will also be valid UTF-32.

The string will be truncated at the first nul value in the string. The resulting string will always be nul-terminated even if the original string is not.

§Examples
use widestring::U32CString;
let s = "My\u{0}String";
// Create a wide string from the string
let wcstr = U32CString::from_str_truncate(s);
assert_eq!(wcstr.to_string_lossy(), "My");
Source

pub unsafe fn from_char_ptr_str(p: *const char) -> Self

Constructs a new wide C string copied from a nul-terminated char string pointer.

This will scan for nul values beginning with p. The first nul value will be used as the nul terminator for the string, similar to how libc string functions such as strlen work.

If you wish to avoid copying the string pointer, use U32CStr::from_char_ptr_str instead.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid or has a nul terminator, and the function could scan past the underlying buffer.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

This function panics if p is null.

§Caveat

The lifetime for the returned string is inferred from its usage. To prevent accidental misuse, it’s suggested to tie the lifetime to whichever source lifetime is safe in the context, such as by providing a helper function taking the lifetime of a host value for the string, or by explicit annotation.

Source

pub unsafe fn from_char_ptr( p: *const char, len: usize, ) -> Result<Self, ContainsNul<u32>>

Constructs a wide C string copied from a char pointer and a length, checking for invalid interior nul values.

The len argument is the number of elements, not the number of bytes, and does not include the nul terminator of the string. If len is 0, p is allowed to be a null pointer.

The resulting string will always be nul-terminated even if the pointer data is not.

§Errors

This will scan the pointer string for an interior nul value and error if one is found. To avoid scanning for interior nuls, from_ptr_unchecked may be used instead. The returned error will contain a Vec as well as the position of the nul value.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub unsafe fn from_char_ptr_truncate(p: *const char, len: usize) -> Self

Constructs a wide C string copied from a char pointer and a length, truncating at the first nul terminator.

The len argument is the number of elements, not the number of bytes. This will scan for nul values beginning with p until offset len. The first nul value will be used as the nul terminator for the string, ignoring any remaining values left before len. If no nul value is found, the whole string of length len is used, and a new nul-terminator will be added to the resulting string. If len is 0, p is allowed to be a null pointer.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub unsafe fn from_char_ptr_unchecked(p: *const char, len: usize) -> Self

Constructs a wide C string copied from a char pointer and a length without checking for any nul values.

The len argument is the number of elements, not the number of bytes, and does not include the nul terminator of the string. If len is 0, p is allowed to be a null pointer.

The resulting string will always be nul-terminated even if the pointer data is not.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

The interior values of the pointer are not scanned for nul. Any interior nul values or will result in an invalid C string.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub fn from_os_str(s: impl AsRef<OsStr>) -> Result<Self, ContainsNul<u32>>

Constructs a U32CString copy from an OsStr, checking for invalid nul values.

This makes a string copy of the OsStr. Since OsStr makes no guarantees that it is valid data, there is no guarantee that the resulting U32CString will be valid UTF-32.

The string will be scanned for nul values, which are invlaid anywhere except the last character. The resulting string will always be nul-terminated even if the string is not.

Note that the encoding of OsStr is platform-dependent, so on some platforms this may make an encoding conversions, while on other platforms no changes to the string will be made.

§Errors

This function will return an error if the data contains a nul value anywhere except the last character. The returned error will contain a Vec<u32> as well as the position of the nul value.

§Examples
use widestring::U32CString;
let s = "MyString";
// Create a wide string from the string
let wcstr = U32CString::from_os_str(s).unwrap();

The following example demonstrates errors from nul values in a string.

use widestring::U32CString;
let s = "My\u{0}String";
// Create a wide string from the string
let res = U32CString::from_os_str(s);
assert!(res.is_err());
assert_eq!(res.err().unwrap().nul_position(), 2);
Source

pub unsafe fn from_os_str_unchecked(s: impl AsRef<OsStr>) -> Self

Constructs a U32CString copy from an OsStr, without checking for nul values.

This makes a string copy of the OsStr. Since OsStr makes no guarantees that it is valid data, there is no guarantee that the resulting U32CString will be valid UTF-32.

The resulting string will always be nul-terminated even if the string is not.

Note that the encoding of OsStr is platform-dependent, so on some platforms this may make an encoding conversions, while on other platforms no changes to the string will be made.

§Safety

This method is equivalent to from_os_str except that no runtime assertion is made that s contains invalid nul values. Providing a string with nul values anywhere except the last character will result in an invalid U32CString.

§Examples
use widestring::U32CString;
let s = "MyString";
// Create a wide string from the string
let wcstr = unsafe { U32CString::from_os_str_unchecked(s) };
Source

pub fn from_os_str_truncate(s: impl AsRef<OsStr>) -> Self

Constructs a U32CString copy from an OsStr, truncating at the first nul terminator.

This makes a string copy of the OsStr. Since OsStr makes no guarantees that it is valid data, there is no guarantee that the resulting U32CString will be valid UTF-32.

The string will be truncated at the first nul value in the string. The resulting string will always be nul-terminated even if the string is not.

Note that the encoding of OsStr is platform-dependent, so on some platforms this may make an encoding conversions, while on other platforms no changes to the string will be made.

§Examples
use widestring::U32CString;
let s = "My\u{0}String";
// Create a wide string from the string
let wcstr = U32CString::from_os_str_truncate(s);
assert_eq!(wcstr.to_string_lossy(), "My");
Source§

impl U32CString

Source

pub const NUL_TERMINATOR: u32 = 0u32

The nul terminator character value.

Source

pub fn new() -> Self

Constructs a new empty wide C string.

Source

pub fn from_vec(v: impl Into<Vec<u32>>) -> Result<Self, ContainsNul<u32>>

Constructs a wide C string from a container of wide character data.

This method will consume the provided data and use the underlying elements to construct a new string. The data will be scanned for invalid interior nul values.

§Errors

This function will return an error if the data contains a nul value that is not the terminating nul. The returned error will contain the original Vec as well as the position of the nul value.

§Examples
use widestring::U32CString;
let v = vec![84u32, 104u32, 101u32]; // 'T' 'h' 'e'
// Create a wide string from the vector
let wcstr = U32CString::from_vec(v).unwrap();

Empty vectors are valid and will return an empty string with a nul terminator:

use widestring::U32CString;
let wcstr = U32CString::from_vec(vec![]).unwrap();
assert_eq!(wcstr, U32CString::default());

The following example demonstrates errors from nul values in a vector.

use widestring::U32CString;
let v = vec![84u32, 0u32, 104u32, 101u32]; // 'T' NUL 'h' 'e'
// Create a wide string from the vector
let res = U32CString::from_vec(v);
assert!(res.is_err());
assert_eq!(res.err().unwrap().nul_position(), 1);
Source

pub fn from_vec_truncate(v: impl Into<Vec<u32>>) -> Self

Constructs a wide C string from a container of wide character data, truncating at the first nul terminator.

The string will be truncated at the first nul value in the data.

§Examples
use widestring::U32CString;
let v = vec![84u32, 104u32, 101u32, 0u32]; // 'T' 'h' 'e' NUL
// Create a wide string from the vector
let wcstr = U32CString::from_vec_truncate(v);
Source

pub unsafe fn from_vec_unchecked(v: impl Into<Vec<u32>>) -> Self

Constructs a wide C string from a vector without checking for interior nul values.

A terminating nul value will be appended if the vector does not already have a terminating nul.

§Safety

This method is equivalent to from_vec except that no runtime assertion is made that v contains no interior nul values. Providing a vector with any nul values that are not the last value in the vector will result in an invalid C string.

Source

pub fn from_ustr(s: impl AsRef<U32Str>) -> Result<Self, ContainsNul<u32>>

Constructs a wide C string from anything that can be converted to a wide string slice.

The string will be scanned for invalid interior nul values.

§Errors

This function will return an error if the data contains a nul value that is not the terminating nul. The returned error will contain a Vec as well as the position of the nul value.

Source

pub fn from_ustr_truncate(s: impl AsRef<U32Str>) -> Self

Constructs a wide C string from anything that can be converted to a wide string slice, truncating at the first nul terminator.

The string will be truncated at the first nul value in the string.

Source

pub unsafe fn from_ustr_unchecked(s: impl AsRef<U32Str>) -> Self

Constructs a wide C string from anything that can be converted to a wide string slice, without scanning for invalid nul values.

§Safety

This method is equivalent to from_ustr except that no runtime assertion is made that v contains no interior nul values. Providing a string with any nul values that are not the last value in the vector will result in an invalid C string.

Source

pub unsafe fn from_ptr_str(p: *const u32) -> Self

Constructs a new wide C string copied from a nul-terminated string pointer.

This will scan for nul values beginning with p. The first nul value will be used as the nul terminator for the string, similar to how libc string functions such as strlen work.

If you wish to avoid copying the string pointer, use U16CStr::from_ptr_str or U32CStr::from_ptr_str instead.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid or has a nul terminator, and the function could scan past the underlying buffer.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

This function panics if p is null.

§Caveat

The lifetime for the returned string is inferred from its usage. To prevent accidental misuse, it’s suggested to tie the lifetime to whichever source lifetime is safe in the context, such as by providing a helper function taking the lifetime of a host value for the string, or by explicit annotation.

Source

pub unsafe fn from_ptr( p: *const u32, len: usize, ) -> Result<Self, ContainsNul<u32>>

Constructs a wide C string copied from a pointer and a length, checking for invalid interior nul values.

The len argument is the number of elements, not the number of bytes, and does not include the nul terminator of the string. If len is 0, p is allowed to be a null pointer.

The resulting string will always be nul-terminated even if the pointer data is not.

§Errors

This will scan the pointer string for an interior nul value and error if one is found. To avoid scanning for interior nuls, from_ptr_unchecked may be used instead. The returned error will contain a Vec as well as the position of the nul value.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub unsafe fn from_ptr_truncate(p: *const u32, len: usize) -> Self

Constructs a wide C string copied from a pointer and a length, truncating at the first nul terminator.

The len argument is the number of elements, not the number of bytes. This will scan for nul values beginning with p until offset len. The first nul value will be used as the nul terminator for the string, ignoring any remaining values left before len. If no nul value is found, the whole string of length len is used, and a new nul-terminator will be added to the resulting string. If len is 0, p is allowed to be a null pointer.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub unsafe fn from_ptr_unchecked(p: *const u32, len: usize) -> Self

Constructs a wide C string copied from a pointer and a length without checking for any nul values.

The len argument is the number of elements, not the number of bytes, and does not include the nul terminator of the string. If len is 0, p is allowed to be a null pointer.

The resulting string will always be nul-terminated even if the pointer data is not.

§Safety

This function is unsafe as there is no guarantee that the given pointer is valid for len elements.

In addition, the data must meet the safety conditions of std::slice::from_raw_parts.

The interior values of the pointer are not scanned for nul. Any interior nul values or will result in an invalid C string.

§Panics

Panics if len is greater than 0 but p is a null pointer.

Source

pub fn as_ucstr(&self) -> &U32CStr

Converts to a wide C string slice.

Source

pub fn as_mut_ucstr(&mut self) -> &mut U32CStr

Converts to a mutable wide C string slice.

Source

pub fn into_ustring(self) -> U32String

Converts this string into a wide string without a nul terminator.

The resulting string will not contain a nul-terminator, and will contain no other nul values.

Source

pub fn into_ustring_with_nul(self) -> U32String

Converts this string into a wide string with a nul terminator.

The resulting vector will contain a nul-terminator and no interior nul values.

Source

pub fn into_vec(self) -> Vec<u32>

Converts the string into a Vec without a nul terminator, consuming the string in the process.

The resulting vector will not contain a nul-terminator, and will contain no other nul values.

Source

pub fn into_vec_with_nul(self) -> Vec<u32>

Converts the string into a Vec, consuming the string in the process.

The resulting vector will contain a nul-terminator and no interior nul values.

Source

pub fn into_raw(self) -> *mut u32

Transfers ownership of the string to a C caller.

§Safety

The pointer must be returned to Rust and reconstituted using from_raw to be properly deallocated. Specifically, one should not use the standard C free function to deallocate this string. Failure to call from_raw will lead to a memory leak.

Source

pub unsafe fn from_raw(p: *mut u32) -> Self

Retakes ownership of a wide C string that was transferred to C.

This should only be used in combination with into_raw. To construct a new wide C string from a pointer, use from_ptr_str.

§Safety

This should only ever be called with a pointer that was earlier obtained by calling into_raw. Additionally, the length of the string will be recalculated from the pointer by scanning for the nul-terminator.

§Panics

Panics if p is a null pointer.

Source

pub fn into_boxed_ucstr(self) -> Box<U32CStr>

Converts this wide C string into a boxed wide C string slice.

§Examples
use widestring::{U32CString, U32CStr};

let mut v = vec![102u32, 111u32, 111u32]; // "foo"
let c_string = U32CString::from_vec(v.clone()).unwrap();
let boxed = c_string.into_boxed_ucstr();
v.push(0);
assert_eq!(&*boxed, U32CStr::from_slice(&v).unwrap());

Trait Implementations

Source§

impl AsMut<U32CStr> for U32CString

Source§

fn as_mut(&mut self) -> &mut U32CStr

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[u32]> for U32CString

Source§

fn as_ref(&self) -> &[u32]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<U32CStr> for U32CString

Source§

fn as_ref(&self) -> &U32CStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<U32Str> for U32CString

Source§

fn as_ref(&self) -> &U32Str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<U32CStr> for U32CString

Source§

fn borrow(&self) -> &U32CStr

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<U32CStr> for U32CString

Source§

fn borrow_mut(&mut self) -> &mut U32CStr

Mutably borrows from an owned value. Read more
Source§

impl Clone for U32CString

Source§

fn clone(&self) -> U32CString

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for U32CString

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for U32CString

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for U32CString

Source§

type Target = U32CStr

The resulting type after dereferencing.
Source§

fn deref(&self) -> &U32CStr

Dereferences the value.
Source§

impl DerefMut for U32CString

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Drop for U32CString

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, T: ?Sized + AsRef<U32CStr>> From<&'a T> for U32CString

Source§

fn from(s: &'a T) -> Self

Converts to this type from the input type.
Source§

impl From<Box<U32CStr>> for U32CString

Source§

fn from(s: Box<U32CStr>) -> Self

Converts to this type from the input type.
Source§

impl Hash for U32CString

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I> Index<I> for U32CString
where I: SliceIndex<[u32], Output = [u32]>,

Source§

type Output = U32Str

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Ord for U32CString

Source§

fn cmp(&self, other: &U32CString) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<'a> PartialEq<&'a U32CStr> for U32CString

Source§

fn eq(&self, other: &&'a U32CStr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<&'a U32Str> for U32CString

Source§

fn eq(&self, other: &&'a U32Str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<Cow<'a, U32CStr>> for U32CString

Source§

fn eq(&self, other: &Cow<'a, U32CStr>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<Cow<'a, U32Str>> for U32CString

Source§

fn eq(&self, other: &Cow<'a, U32Str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<U32CStr> for U32CString

Source§

fn eq(&self, other: &U32CStr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<U32Str> for U32CString

Source§

fn eq(&self, other: &U32Str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<U32String> for U32CString

Source§

fn eq(&self, other: &U32String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Utf32Str> for U32CString

Source§

fn eq(&self, other: &Utf32Str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Utf32String> for U32CString

Source§

fn eq(&self, other: &Utf32String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for U32CString

Source§

fn eq(&self, other: &U32CString) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd<&'a U32CStr> for U32CString

Source§

fn partial_cmp(&self, other: &&'a U32CStr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> PartialOrd<&'a U32Str> for U32CString

Source§

fn partial_cmp(&self, other: &&'a U32Str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> PartialOrd<Cow<'a, U32CStr>> for U32CString

Source§

fn partial_cmp(&self, other: &Cow<'a, U32CStr>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> PartialOrd<Cow<'a, U32Str>> for U32CString

Source§

fn partial_cmp(&self, other: &Cow<'a, U32Str>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<U32CStr> for U32CString

Source§

fn partial_cmp(&self, other: &U32CStr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<U32Str> for U32CString

Source§

fn partial_cmp(&self, other: &U32Str) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<U32String> for U32CString

Source§

fn partial_cmp(&self, other: &U32String) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd for U32CString

Source§

fn partial_cmp(&self, other: &U32CString) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for U32CString

Source§

impl StructuralPartialEq for U32CString