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.

Trait Implementations

impl<T> FromSql for ArrayBase<Option<T>> where T: FromSql

fn from_sql<R: Read>(ty: &Type, raw: &mut R) -> Result<ArrayBase<Option<T>>>

fn accepts(ty: &Type) -> bool

fn from_sql_nullable<R>(ty: &Type, raw: Option<&mut R>) -> Result<Self, Error> where R: Read

impl<T> ToSql for ArrayBase<Option<T>> where T: ToSql

fn to_sql<W: ?Sized + Write>(&self, ty: &Type, w: &mut W) -> Result<IsNull>

fn accepts(ty: &Type) -> bool

fn to_sql_checked(&self, ty: &Type, out: &mut Write) -> Result<IsNull>

impl<T> Array<T> for ArrayBase<T>

fn dimension_info<'a>(&'a self) -> &'a [DimensionInfo]

fn slice<'a>(&'a self, idx: isize) -> ArraySlice<'a, T>

fn get<'a>(&'a self, idx: isize) -> &'a T

impl<T> MutableArray<T> for ArrayBase<T>

fn slice_mut<'a>(&'a mut self, idx: isize) -> MutArraySlice<'a, T>

fn get_mut<'a>(&'a mut self, idx: isize) -> &'a mut T

Derived Implementations

impl<T: Debug> Debug for ArrayBase<T> where T: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<T: Clone> Clone for ArrayBase<T> where T: Clone

fn clone(&self) -> ArrayBase<T>

fn clone_from(&mut self, source: &Self)

impl<T: Eq> Eq for ArrayBase<T> where T: Eq

impl<T: PartialEq> PartialEq for ArrayBase<T> where T: PartialEq

fn eq(&self, __arg_0: &ArrayBase<T>) -> bool

fn ne(&self, __arg_0: &ArrayBase<T>) -> bool