Enum nt_hive::NtHiveNameString [−][src]
Zero-copy representation of a key name or value name string stored in hive data. Can be either in Latin1 (ISO-8859-1) or UTF-16 (Little-Endian).
This allows to work with the string without performing any allocations or conversions.
If the alloc
feature is enabled, to_string_checked
and
to_string_lossy
can be used to to retrieve a String
.
Variants
A byte stream where each byte is a single character of the Latin1 (ISO-8859-1)
character set.
Each byte can simply be casted to a char
(as Unicode is ordered the same as Latin1).
A byte stream where every two bytes make up a UTF-16 code point in little-endian order.
Use u16::from_le_bytes
and char::decode_utf16
if you want to get a stream of char
s.
Implementations
impl<'a> NtHiveNameString<'a>
[src]
pub const fn is_empty(&self) -> bool
[src]
Returns true
if self
has a length of zero bytes.
pub const fn len(&self) -> usize
[src]
Returns the length of self
.
This length is in bytes, not characters! In other words, it may not be what a human considers the length of the string.
pub fn to_string_checked(&self) -> Option<String>
[src]
Attempts to convert self
to an owned String
.
Returns Some(String)
if all characters could be converted successfully or None
if a decoding error occurred.
pub fn to_string_lossy(&self) -> String
[src]
Converts self
to an owned String
, replacing invalid data with the replacement character (U+FFFD).
Trait Implementations
impl<'a> Clone for NtHiveNameString<'a>
[src]
fn clone(&self) -> NtHiveNameString<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for NtHiveNameString<'a>
[src]
impl<'a> Display for NtHiveNameString<'a>
[src]
impl<'a> Eq for NtHiveNameString<'a>
[src]
impl<'a> Ord for NtHiveNameString<'a>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a> PartialEq<&'_ str> for NtHiveNameString<'a>
[src]
impl<'a> PartialEq<NtHiveNameString<'a>> for NtHiveNameString<'a>
[src]
fn eq(&self, other: &Self) -> bool
[src]
Checks that two strings are a case-insensitive match (according to Windows' definition of case-insensitivity, which only considers the Unicode Basic Multilingual Plane).
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<str> for NtHiveNameString<'a>
[src]
impl<'a> PartialOrd<&'_ str> for NtHiveNameString<'a>
[src]
fn partial_cmp(&self, other: &&str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialOrd<NtHiveNameString<'a>> for NtHiveNameString<'a>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialOrd<str> for NtHiveNameString<'a>
[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> StructuralEq for NtHiveNameString<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for NtHiveNameString<'a>
[src]
impl<'a> Send for NtHiveNameString<'a>
[src]
impl<'a> Sync for NtHiveNameString<'a>
[src]
impl<'a> Unpin for NtHiveNameString<'a>
[src]
impl<'a> UnwindSafe for NtHiveNameString<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,