[−][src]Struct wmi::safearray::SafeArrayAccessor
Methods
impl<T> SafeArrayAccessor<T>
[src]
An accessor to SafeArray, which:
- Locks the array so the data can be read.
- Unlocks the array once dropped.
Pointers to a Safe Array can come from different places (like GetNames, WMI property value), which can have different drop behavior (GetNames require the caller to deallocate the array, while a WMI property must be deallocated via VariantClear).
For this reason, we don't have a struct SafeArray
.
However, accessing the data of the array must be done using a lock, which is the responsibility of this struct.
pub unsafe fn new(arr: *mut SAFEARRAY) -> Result<Self, Error>
[src]
Creates a new Accessor, locking the given array,
Safety
This function is unsafe as it is the caller's responsibility to verify that the array is of items of type T.
pub fn as_slice(&self) -> &[T]
[src]
Return a slice which can access the data of the array.
Trait Implementations
impl<T> Drop for SafeArrayAccessor<T>
[src]
impl<T: Debug> Debug for SafeArrayAccessor<T>
[src]
Auto Trait Implementations
impl<T> !Send for SafeArrayAccessor<T>
impl<T> !Sync for SafeArrayAccessor<T>
impl<T> Unpin for SafeArrayAccessor<T>
impl<T> UnwindSafe for SafeArrayAccessor<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> RefUnwindSafe for SafeArrayAccessor<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,