Struct postgres_array::ArrayBase
[-] [+]
[src]
pub struct ArrayBase<T> { // some fields omitted }
A multi-dimensional array
Methods
impl<T> ArrayBase<T>
fn from_raw(data: Vec<T>, info: Vec<DimensionInfo>) -> ArrayBase<T>
Creates a new multi-dimensional array from its underlying components.
The data array should be provided in the higher-dimensional equivalent of row-major order.
Failure
Fails if there are 0 dimensions or the number of elements provided does not match the number of elements specified.
fn from_vec(data: Vec<T>, lower_bound: isize) -> ArrayBase<T>
Creates a new one-dimensional array from a vector.
fn wrap(&mut self, lower_bound: isize)
Wraps this array in a new dimension of size 1.
For example the one-dimensional array [1,2]
would turn into
the two-dimensional array [[1,2]]
.
fn push_move(&mut self, other: ArrayBase<T>)
Takes ownership of another array, appending it to the top-level dimension of this array.
The dimensions of the other array must have an identical shape to the dimensions of a slice of this array. This includes both the sizes of the dimensions as well as their lower bounds.
For example, if [3,4]
is pushed onto [[1,2]]
, the result is
[[1,2],[3,4]]
.
Failure
Fails if the other array does not have dimensions identical to the dimensions of a slice of this array.
fn values<'a>(&'a self) -> Iter<'a, T>
Returns an iterator over the values in this array, in the higher-dimensional equivalent of row-major order.