Skip to main content

Array

Struct Array 

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

Source

pub fn empty() -> Array<T>

Source

pub fn one(values: Vec<Option<T>>) -> Array<T>

A one-dimensional array with the lower bound 1, or the empty array when there are no values.

Source

pub fn vector(values: Vec<Option<T>>) -> Array<T>

The array of an int2vector or an oidvector: one dimension with the lower bound 0, or the empty array when there are no values.

Source§

impl<T> Array<T>

Source

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.

Source

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.

Trait Implementations§

Source§

impl<T: Clone> Clone for Array<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Array<T>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T: Eq> Eq for Array<T>

Source§

impl<T: PartialEq> PartialEq for Array<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for Array<T>

Auto Trait Implementations§

§

impl<T> Freeze for Array<T>
where Vec<Option<T>>: Freeze,

§

impl<T> RefUnwindSafe for Array<T>

§

impl<T> Send for Array<T>
where Vec<Option<T>>: Send,

§

impl<T> Sync for Array<T>
where Vec<Option<T>>: Sync,

§

impl<T> Unpin for Array<T>
where Vec<Option<T>>: Unpin,

§

impl<T> UnsafeUnpin for Array<T>
where Vec<Option<T>>: UnsafeUnpin,

§

impl<T> UnwindSafe for Array<T>
where Vec<Option<T>>: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.