Struct oracle::sql_type::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.
Implementations
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: &dyn ToSql) -> Result<()>
[src]
Sets the value to the element at the specified index.
pub fn push(&mut self, value: &dyn 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]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Collection
[src]
impl Display for Collection
[src]
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, _conn: &Connection) -> Result<OracleType>
[src]
fn to_sql(&self, val: &mut SqlValue) -> Result<()>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Collection
impl !Send for Collection
impl !Sync for Collection
impl Unpin for Collection
impl UnwindSafe for Collection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,