pub struct Array<T> {
pub dims: Vec<ArrayDim>,
pub values: Vec<Option<T>>,
}Expand description
An array value. The elements are in row-major order, and None is a null element. An empty array has no dimensions.
Fields§
§dims: Vec<ArrayDim>§values: Vec<Option<T>>Implementations§
Source§impl<T> Array<T>
impl<T> Array<T>
Source§impl<T> Array<T>
impl<T> Array<T>
Sourcepub fn set_element(
self,
subscripts: &[i32],
value: Option<T>,
) -> Result<Array<T>, TypeError>
pub fn set_element( self, subscripts: &[i32], value: Option<T>, ) -> Result<Array<T>, TypeError>
array_set_element: the array with value at the subscripts. The empty array becomes an array with one element at the subscripts. A one-dimensional array grows with null elements to reach a subscript outside it, and another array gives an error for a subscript outside it.
§Errors
2202E for a number of subscripts that is not the number of dimensions and for a subscript outside an array of more than one dimension, and 54000 for an array that becomes too large.
Sourcepub fn set_slice(
self,
lower: &[Option<i32>],
upper: &[Option<i32>],
source: Array<T>,
) -> Result<Array<T>, TypeError>
pub fn set_slice( self, lower: &[Option<i32>], upper: &[Option<i32>], source: Array<T>, ) -> Result<Array<T>, TypeError>
array_set_slice: the array with the elements of source in the slice between the bounds, in the order of storage. A bound that the query does not give is the bound of the array, and a dimension with no subscripts is the full dimension. The empty array becomes an array with the dimensions of the slice, whose bounds must all be given. A one-dimensional array grows with null elements to reach the slice. The elements of source after the elements that the slice needs do not count.
§Errors
2202E for more subscripts than dimensions, for a missing bound of a slice of the empty array, for an upper bound under its lower bound, for a bound outside an array of more than one dimension and for a source with too few elements, and 54000 for an array that becomes too large.