[−][src]Struct winstr::BStr
&BStr
is a non-null, borrowed, BSTR (32-bit length prefixed UTF-16ish string). Unlike &OsStr or &str, this is not a DST!
Implementations
impl BStr
[src]
pub unsafe fn from_bstr(bstr: &BSTR) -> Option<&BStr>
[src]
Converts a &BSTR into an Option<&BStr>. By requiring a reference, this API bounds &BStr's lifetime, helping avoid bugs.
Safety
bstr
must be null, or a valid BSTR for the duration of&BStr
's lifetime.
pub unsafe fn from_bstr_unbounded<'b>(bstr: BSTR) -> Option<&'b BStr>
[src]
pub fn as_bstr(&self) -> BSTR
[src]
The &BStr
as a winapi-friendly BSTR
.
Safety
s.as_bstr()
is guaranteed to be0u16
-terminated- It is not safe to modify the contents of the BSTR through the returned pointer!
pub fn len32(&self) -> u32
[src]
pub fn units0(&self) -> &[u16]
[src]
impl BStr
[src]
pub fn as_lpcwstr(&self) -> LPCWSTR
[src]
LPCWSTR / * const wchar_t
pub fn len320(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn len0(&self) -> usize
[src]
pub fn units(&self) -> &[u16]
[src]
Trait Implementations
impl AsRef<[u16]> for BStr
[src]
impl AsRef<BStr> for BString
[src]
impl AsRef<BStr> for BStr
[src]
impl Borrow<[u16]> for BStr
[src]
impl Borrow<BStr> for BString
[src]
impl Debug for BStr
[src]
impl Display for BStr
[src]
impl<'_> Eq for &'_ BStr
[src]
impl<'_> From<&'_ BStr> for BString
[src]
impl<'_> Hash for &'_ BStr
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_> Ord for &'_ BStr
[src]
fn cmp(&self, other: &&BStr) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'_, '_> PartialEq<&'_ [u16]> for &'_ BStr
[src]
impl<'_, '_> PartialEq<&'_ BStr> for &'_ BStr
[src]
impl<'_> PartialEq<&'_ BStr> for BString
[src]
impl<'_, '_> PartialEq<&'_ BStr> for &'_ Path
[src]
impl<'_> PartialEq<&'_ BStr> for Path
[src]
impl<'_> PartialEq<&'_ BStr> for PathBuf
[src]
impl<'_, '_> PartialEq<&'_ BStr> for Cow<'_, [u16]>
[src]
impl<'_, '_> PartialEq<&'_ BStr> for Cow<'_, str>
[src]
impl<'_, '_> PartialEq<&'_ BStr> for Cow<'_, OsStr>
[src]
impl<'_, '_> PartialEq<&'_ BStr> for Cow<'_, Path>
[src]
impl<'_, '_> PartialEq<&'_ BStr> for &'_ [u16]
[src]
impl<'_> PartialEq<&'_ BStr> for [u16]
[src]
impl<'_, '_> PartialEq<&'_ BStr> for &'_ str
[src]
impl<'_> PartialEq<&'_ BStr> for str
[src]
impl<'_> PartialEq<&'_ BStr> for String
[src]
impl<'_, '_> PartialEq<&'_ BStr> for &'_ OsStr
[src]
impl<'_> PartialEq<&'_ BStr> for OsStr
[src]
impl<'_> PartialEq<&'_ BStr> for OsString
[src]
impl<'_, '_> PartialEq<&'_ OsStr> for &'_ BStr
[src]
impl<'_, '_> PartialEq<&'_ Path> for &'_ BStr
[src]
impl<'_, '_> PartialEq<&'_ str> for &'_ BStr
[src]
impl<'_> PartialEq<[u16]> for &'_ BStr
[src]
impl<'_> PartialEq<BString> for &'_ BStr
[src]
impl<'_, '_> PartialEq<Cow<'_, [u16]>> for &'_ BStr
[src]
fn eq(&self, other: &Cow<'_, [u16]>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<Cow<'_, OsStr>> for &'_ BStr
[src]
fn eq(&self, other: &Cow<'_, OsStr>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<Cow<'_, Path>> for &'_ BStr
[src]
fn eq(&self, other: &Cow<'_, Path>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<Cow<'_, str>> for &'_ BStr
[src]
fn eq(&self, other: &Cow<'_, str>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<OsStr> for &'_ BStr
[src]
impl<'_> PartialEq<OsString> for &'_ BStr
[src]
impl<'_> PartialEq<Path> for &'_ BStr
[src]
impl<'_> PartialEq<PathBuf> for &'_ BStr
[src]
impl<'_> PartialEq<String> for &'_ BStr
[src]
impl<'_> PartialEq<str> for &'_ BStr
[src]
impl<'_, '_> PartialOrd<&'_ [u16]> for &'_ BStr
[src]
fn partial_cmp(&self, other: &&[u16]) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for &'_ BStr
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for BString
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for &'_ Path
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for Path
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for PathBuf
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for Cow<'_, [u16]>
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for Cow<'_, str>
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for Cow<'_, OsStr>
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for Cow<'_, Path>
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for &'_ [u16]
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for [u16]
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for &'_ str
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for str
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for String
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ BStr> for &'_ OsStr
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for OsStr
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ BStr> for OsString
[src]
fn partial_cmp(&self, other: &&BStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ OsStr> for &'_ BStr
[src]
fn partial_cmp(&self, other: &&OsStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ Path> for &'_ BStr
[src]
fn partial_cmp(&self, other: &&Path) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ str> for &'_ BStr
[src]
fn partial_cmp(&self, other: &&str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<[u16]> for &'_ BStr
[src]
fn partial_cmp(&self, other: &[u16]) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<BString> for &'_ BStr
[src]
fn partial_cmp(&self, other: &BString) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<Cow<'_, [u16]>> for &'_ BStr
[src]
fn partial_cmp(&self, other: &Cow<'_, [u16]>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<Cow<'_, OsStr>> for &'_ BStr
[src]
fn partial_cmp(&self, other: &Cow<'_, OsStr>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<Cow<'_, Path>> for &'_ BStr
[src]
fn partial_cmp(&self, other: &Cow<'_, Path>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<Cow<'_, str>> for &'_ BStr
[src]
fn partial_cmp(&self, other: &Cow<'_, str>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<OsStr> for &'_ BStr
[src]
fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<OsString> for &'_ BStr
[src]
fn partial_cmp(&self, other: &OsString) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<Path> for &'_ BStr
[src]
fn partial_cmp(&self, other: &Path) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<PathBuf> for &'_ BStr
[src]
fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<String> for &'_ BStr
[src]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<str> for &'_ BStr
[src]
Auto Trait Implementations
impl RefUnwindSafe for BStr
impl Send for BStr
impl Sync for BStr
impl Unpin for BStr
impl UnwindSafe for BStr
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> 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>,