Struct windows_core::BSTR

pub struct BSTR(/* private fields */);
Expand description

A BSTR string (BSTR) is a length-prefixed wide string.

Implementations§

source§

impl BSTR

source

pub const fn new() -> BSTR

Create an empty BSTR.

This function does not allocate memory.

source

pub fn is_empty(&self) -> bool

Returns true if the string is empty.

source

pub fn len(&self) -> usize

Returns the length of the string.

source

pub fn as_wide(&self) -> &[u16]

Get the string as 16-bit wide characters (wchars).

source

pub fn as_ptr(&self) -> *const u16

Returns a raw pointer to the BSTR buffer.

source

pub fn from_wide(value: &[u16]) -> Result<BSTR, Error>

Create a BSTR from a slice of 16 bit characters (wchars).

Trait Implementations§

source§

impl Clone for BSTR

source§

fn clone(&self) -> BSTR

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 BSTR

source§

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

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

impl Default for BSTR

source§

fn default() -> BSTR

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

impl Display for BSTR

source§

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

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

impl Drop for BSTR

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<&String> for BSTR

source§

fn from(value: &String) -> BSTR

Converts to this type from the input type.
source§

impl From<&str> for BSTR

source§

fn from(value: &str) -> BSTR

Converts to this type from the input type.
§

impl From<BSTR> for PROPVARIANT

§

fn from(value: BSTR) -> Self

Converts to this type from the input type.
§

impl From<BSTR> for VARIANT

§

fn from(value: BSTR) -> Self

Converts to this type from the input type.
source§

impl From<String> for BSTR

source§

fn from(value: String) -> BSTR

Converts to this type from the input type.
source§

impl PartialEq<BSTR> for &str

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<T> for BSTR
where T: AsRef<str> + ?Sized,

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for BSTR

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl TryFrom<&PROPVARIANT> for BSTR

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(from: &PROPVARIANT) -> Result<Self>

Performs the conversion.
§

impl TryFrom<&VARIANT> for BSTR

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(from: &VARIANT) -> Result<Self>

Performs the conversion.
source§

impl Eq for BSTR

§

impl Param<PCWSTR> for &BSTR

Auto Trait Implementations§

§

impl Freeze for BSTR

§

impl RefUnwindSafe for BSTR

§

impl !Send for BSTR

§

impl !Sync for BSTR

§

impl Unpin for BSTR

§

impl UnwindSafe for BSTR

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.