Struct postgres_array::ArrayBase [] [src]

pub struct ArrayBase<T> {
    // some fields omitted
}

A multi-dimensional array

Methods

impl<T> ArrayBase<T>
[src]

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
[src]

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

Creates a new value of this type from a Reader of the binary format of the specified Postgres Type. Read more

fn accepts(ty: &Type) -> bool

Determines if a value of this type can be created from the specified Postgres Type. Read more

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

Creates a new value of this type from a Read of Postgres data. Read more

impl<T> ToSql for ArrayBase<Option<T>> where T: ToSql
[src]

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

Converts the value of self into the binary format of the specified Postgres Type, writing it to out. Read more

fn accepts(ty: &Type) -> bool

Determines if a value of this type can be converted to the specified Postgres Type. Read more

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

An adaptor method used internally by Rust-Postgres. Read more

impl<T: Debug> Debug for ArrayBase<T>
[src]

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

Formats the value using the given formatter.

impl<T: Clone> Clone for ArrayBase<T>
[src]

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

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<T: Eq> Eq for ArrayBase<T>
[src]

impl<T: PartialEq> PartialEq for ArrayBase<T>
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl<T> Array<T> for ArrayBase<T>
[src]

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

Returns information about the dimensions of this array

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

Slices into this array, returning an immutable view of a subarray. Read more

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

Retrieves an immutable reference to a value in this array. Read more

impl<T> MutableArray<T> for ArrayBase<T>
[src]

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

Slices into this array, returning a mutable view of a subarray. Read more

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

Retrieves a mutable reference to a value in this array. Read more