[−][src]Struct oracle::sql_type::ObjectType
Type information about Object or Collection data type
This is for not only Object type information but also collection type information.
Examples
Gets MDSYS.SDO_GEOMETRY object type information.
let conn = Connection::connect("scott", "tiger", "")?; let objtype = conn.object_type("MDSYS.SDO_GEOMETRY");
Gets object type infomration in query.
let conn = Connection::connect("scott", "tiger", "")?; // conn.execute("create table location (name varchar2(60), loc sdo_geometry)", &[]); let mut stmt = conn.prepare("select loc from location where name = '...'", &[])?; let rows = stmt.query(&[])?; let objtype = if let OracleType::Object(ref objtype) = *rows.column_info()[0].oracle_type() { objtype } else { panic!("Not an object type") };
Implementations
impl ObjectType
[src]
pub fn schema(&self) -> &str
[src]
Gets schema name
pub fn name(&self) -> &str
[src]
Gets object name
pub fn is_collection(&self) -> bool
[src]
True when it is a collectoin. Otherwise false.
pub fn element_oracle_type(&self) -> Option<&OracleType>
[src]
Gets the Oracle type of elements if it is a collection.
Otherwise, None
.
pub fn num_attributes(&self) -> usize
[src]
Gets the number of attributes if it isn't a collection. Otherwise, 0.
pub fn attributes(&self) -> &[ObjectTypeAttr]
[src]
Gets a vector of attribute information if it isn't a collection. Otherwise, a zero-length vector.
Examples
Prints attribute information of MDSYS.SDO_GEOMETRY
.
let conn = Connection::connect("scott", "tiger", "")?; let objtype = conn.object_type("MDSYS.SDO_GEOMETRY")?; for attr in objtype.attributes() { println!("{:-20} {}", attr.name(), attr.oracle_type()); }
pub fn new_object(&self) -> Result<Object>
[src]
Create a new Oracle object.
pub fn new_collection(&self) -> Result<Collection>
[src]
Create a new collection.
Trait Implementations
impl Clone for ObjectType
[src]
fn clone(&self) -> ObjectType
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ObjectType
[src]
impl Display for ObjectType
[src]
impl PartialEq<ObjectType> for ObjectType
[src]
Auto Trait Implementations
impl RefUnwindSafe for ObjectType
impl Send for ObjectType
impl Sync for ObjectType
impl Unpin for ObjectType
impl UnwindSafe for ObjectType
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,