Struct oracle::Collection
[−]
[src]
pub struct Collection { /* fields omitted */ }
Oracle-specific collection data type
This type corresponds to varray and nested table data types. See Oracle manual.
let conn = Connection::connect("scott", "tiger", "", &[])?; // MDSYS.SDO_ELEM_INFO_ARRAY is defined as VARRAY (1048576) of NUMBER. let objtype = conn.object_type("MDSYS.SDO_ELEM_INFO_ARRAY")?; // Create a new collection let mut obj = objtype.new_collection()?; obj.push(&1); obj.push(&3); assert_eq!(obj.to_string(), "MDSYS.SDO_ELEM_INFO_ARRAY(1, 3)");
Note: Methods in the type may be changed in future.
Methods
impl Collection
[src]
pub fn object_type(&self) -> &ObjectType
[src]
Returns type information.
pub fn size(&self) -> Result<i32>
[src]
Returns the number of elements.
This counts also deleted elements. See "Comments" about OCICollSize().
pub fn first_index(&self) -> Result<i32>
[src]
Returns the first index.
Use this method if indexes of the collection isn't continuous.
pub fn last_index(&self) -> Result<i32>
[src]
Returns the last index.
Use this method if indexes of the collection isn't continuous.
pub fn next_index(&self, index: i32) -> Result<i32>
[src]
Returns the next index following the specified index.
Use this method if indexes of the collection isn't continuous.
pub fn prev_index(&self, index: i32) -> Result<i32>
[src]
Returns the previous index following the specified index.
Use this method if indexes of the collection isn't continuous.
pub fn exist(&self, index: i32) -> Result<bool>
[src]
Returns whether an element exists at the specified index.
pub fn get<T>(&self, index: i32) -> Result<T> where
T: FromSql,
[src]
T: FromSql,
Returns the value of the element at the specified index.
pub fn set(&mut self, index: i32, value: &ToSql) -> Result<()>
[src]
Sets the value to the element at the specified index.
pub fn push(&mut self, value: &ToSql) -> Result<()>
[src]
Appends an element to the end of the collection.
pub fn remove(&mut self, index: i32) -> Result<()>
[src]
Remove the element at the specified index. Note that the position ordinals of the remaining elements are not changed. The operation creates holes in the collection.
pub fn trim(&mut self, len: usize) -> Result<()>
[src]
Trims a number of elements from the end of a collection.
If the number of of elements to trim exceeds the current size of the collection an error is returned.
Trait Implementations
impl Clone for Collection
[src]
fn clone(&self) -> Collection
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Drop for Collection
[src]
impl FromSql for Collection
[src]
fn from_sql(val: &SqlValue) -> Result<Collection>
[src]
impl ToSql for Collection
[src]
fn oratype(&self) -> Result<OracleType>
[src]
fn to_sql(&self, val: &mut SqlValue) -> Result<()>
[src]
impl Display for Collection
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more