[−][src]Struct winstr::BString
Implementations
impl BString
[src]
pub fn from_code_units(
code_units: impl ExactSizeIterator + Iterator<Item = u16>
) -> Option<BString>
[src]
code_units: impl ExactSizeIterator + Iterator<Item = u16>
) -> Option<BString>
impl BString
[src]
pub fn from_str(s: impl AsRef<str>) -> Option<Self>
[src]
pub fn from_osstr(s: impl AsRef<OsStr>) -> Option<Self>
[src]
pub fn from_bstr(s: impl AsRef<BStr>) -> Option<Self>
[src]
Methods from Deref<Target = BStr>
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]
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 BString
[src]
impl AsRef<BStr> for BString
[src]
impl Borrow<[u16]> for BString
[src]
impl Borrow<BStr> for BString
[src]
impl Clone for BString
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BString
[src]
impl Deref for BString
[src]
impl Display for BString
[src]
impl Drop for BString
[src]
impl Eq for BString
[src]
impl<'_> From<&'_ BStr> for BString
[src]
impl<'_> From<&'_ OsStr> for BString
[src]
impl<'_> From<&'_ OsString> for BString
[src]
impl<'_> From<&'_ String> for BString
[src]
impl<'_> From<&'_ str> for BString
[src]
impl From<OsString> for BString
[src]
impl From<String> for BString
[src]
impl Hash for BString
[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 BString
[src]
fn cmp(&self, other: &BString) -> 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 BString
[src]
impl<'_> PartialEq<&'_ BStr> for BString
[src]
impl<'_> PartialEq<&'_ OsStr> for BString
[src]
impl<'_> PartialEq<&'_ Path> for BString
[src]
impl<'_> PartialEq<&'_ str> for BString
[src]
impl PartialEq<[u16]> for BString
[src]
impl PartialEq<BString> for BString
[src]
impl<'_> PartialEq<BString> for &'_ BStr
[src]
impl<'_> PartialEq<BString> for &'_ Path
[src]
impl PartialEq<BString> for Path
[src]
impl PartialEq<BString> for PathBuf
[src]
impl<'_> PartialEq<BString> for Cow<'_, [u16]>
[src]
impl<'_> PartialEq<BString> for Cow<'_, str>
[src]
impl<'_> PartialEq<BString> for Cow<'_, OsStr>
[src]
impl<'_> PartialEq<BString> for Cow<'_, Path>
[src]
impl<'_> PartialEq<BString> for &'_ str
[src]
impl PartialEq<BString> for str
[src]
impl<'_> PartialEq<BString> for &'_ [u16]
[src]
impl PartialEq<BString> for [u16]
[src]
impl PartialEq<BString> for String
[src]
impl<'_> PartialEq<BString> for &'_ OsStr
[src]
impl PartialEq<BString> for OsStr
[src]
impl PartialEq<BString> for OsString
[src]
impl<'_> PartialEq<Cow<'_, [u16]>> for BString
[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 BString
[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 BString
[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 BString
[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 BString
[src]
impl PartialEq<OsString> for BString
[src]
impl PartialEq<Path> for BString
[src]
impl PartialEq<PathBuf> for BString
[src]
impl PartialEq<String> for BString
[src]
impl PartialEq<str> for BString
[src]
impl<'_> PartialOrd<&'_ [u16]> for BString
[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 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<&'_ OsStr> for BString
[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 BString
[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 BString
[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 BString
[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 BString
[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<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<BString> for &'_ Path
[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<BString> for Path
[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<BString> for PathBuf
[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<BString> for Cow<'_, [u16]>
[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<BString> for Cow<'_, str>
[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<BString> for Cow<'_, OsStr>
[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<BString> for Cow<'_, Path>
[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<BString> for &'_ str
[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<BString> for str
[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<BString> for &'_ [u16]
[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<BString> for [u16]
[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<BString> for String
[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<BString> for &'_ OsStr
[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<BString> for OsStr
[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<BString> for OsString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 BString
[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 Send for BString
[src]
This assumes SysFreeString
is thread safe (in the sense that you can call it on a BSTR allocated by another thread.)
Considering how much BSTRs are used throughout MTA COM, SysFreeString
better be thread safe!
While MSDN's documentation is limited on this front, stack overflow confirms:
Q: Is it safe to deallocate a BSTR on a different thread than it was allocated on?
A: [...] All together, it is okay to free string from another thread.
Auto Trait Implementations
impl RefUnwindSafe for BString
impl !Sync for BString
impl Unpin for BString
impl UnwindSafe for BString
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>,