Struct wmi::safearray::SafeArrayAccessor
source · pub struct SafeArrayAccessor<T> { /* private fields */ }
Implementations§
source§impl<T> SafeArrayAccessor<T>
impl<T> SafeArrayAccessor<T>
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.