pub struct BSTR(/* private fields */);
Available on crate feature
oleaut
only.Expand description
A string data type used with COM automation.
Automatically calls
SysFreeString
when the object goes out of scope.
Implementations§
Source§impl BSTR
impl BSTR
Sourcepub fn SysAllocString(s: &str) -> HrResult<Self>
pub fn SysAllocString(s: &str) -> HrResult<Self>
SysAllocString
function.
Sourcepub fn SysReAllocString(&mut self, s: &str) -> HrResult<()>
pub fn SysReAllocString(&mut self, s: &str) -> HrResult<()>
SysReAllocString
function.
The underlying pointer is automatically updated.
Sourcepub fn SysStringLen(&self) -> u32
pub fn SysStringLen(&self) -> u32
SysStringLen
function.
Sourcepub const unsafe fn from_ptr(p: *mut u16) -> Self
pub const unsafe fn from_ptr(p: *mut u16) -> Self
Creates a new BSTR
by wrapping a pointer.
§Safety
Be sure the pointer has the correct type and isn’t owned by anyone else, otherwise you may cause memory access violations.
Sourcepub const fn as_ptr(&self) -> *mut u16
pub const fn as_ptr(&self) -> *mut u16
Returns the underlying
LPWSTR
pointer to the null-terminated wide string.
Sourcepub const fn as_mut_ptr(&mut self) -> *mut *mut u16
pub const fn as_mut_ptr(&mut self) -> *mut *mut u16
Returns a pointer to the underlying
LPWSTR
pointer to the null-terminated wide string.
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more