Skip to main content

ArrayDimensions

Struct ArrayDimensions 

Source
pub struct ArrayDimensions { /* private fields */ }
Expand description

The dimensions of an array PropertyObject (ArrayDimensions).

A non-array property reports zero dimensions, so this is safe to ask for on anything.

Bounds are read and written as strings such as [0,0] and [2,4]. The engine also exposes them as SAFEARRAYs, but the string form carries the same information through the ordinary dispatch path.

Implementations§

Source§

impl ArrayDimensions

Source

pub fn num_dimensions(&self) -> Result<i32, Error>

How many dimensions the array has; 0 when it is not an array (NumDimensions).

§Errors

Error if the COM call fails or returns an unexpected type.

Source

pub fn lower_bounds_string(&self) -> Result<String, Error>

The lower bound of each dimension, e.g. [0,0] (LowerBoundsString).

§Errors

Error if the COM call fails or returns an unexpected type.

Source

pub fn upper_bounds_string(&self) -> Result<String, Error>

The upper bound of each dimension, e.g. [2,4] (UpperBoundsString).

§Errors

Error if the COM call fails or returns an unexpected type.

Source

pub fn set_bounds_by_strings( &self, lower: &str, upper: &str, ) -> Result<(), Error>

Sets both bounds from their string forms (SetBoundsByStrings).

Resizing does not move existing elements to keep their indices, so an element’s position can change; rebuild the contents afterwards rather than assuming they survived.

§Errors

Error if the COM call fails.

Source

pub fn lengths(&self) -> Result<Vec<i32>, Error>

The per-dimension lengths, derived from the bounds.

[0,0]..[2,4] yields [3, 5].

§Errors

Error if the COM call fails or a bound cannot be parsed.

Trait Implementations§

Source§

impl Debug for ArrayDimensions

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.