pub struct SafeArrayAccessor<T> { /* private fields */ }

Implementations

An accessor to SafeArray, which:

  1. Locks the array so the data can be read.
  2. 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.

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.

Return a slice which can access the data of the array.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.