Struct oracle::ColumnInfo [−][src]
Column information in a select statement
Examples
Print column information of emp
table.
let conn = Connection::connect("scott", "tiger", "")?; let mut stmt = conn.prepare("select * from emp", &[])?; let rows = stmt.query(&[])?; println!(" {:-30} {:-8} {}", "Name", "Null?", "Type"); println!(" {:-30} {:-8} {}", "------------------------------", "--------", "----------------------------"); for info in rows.column_info() { println!("{:-30} {:-8} {}", info.name(), if info.nullable() {""} else {"NOT NULL"}, info.oracle_type()); }
The output is:
Name Null? Type
------------------------------ -------- ----------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
Implementations
impl ColumnInfo
[src]
pub fn name(&self) -> &str
[src]
Gets column name
pub fn oracle_type(&self) -> &OracleType
[src]
Gets Oracle type
pub fn nullable(&self) -> bool
[src]
Gets whether the column may be NULL.
False when the column is defined as NOT NULL
.
Trait Implementations
impl Clone for ColumnInfo
[src]
fn clone(&self) -> ColumnInfo
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ColumnInfo
[src]
impl Display for ColumnInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for ColumnInfo
impl Send for ColumnInfo
impl Sync for ColumnInfo
impl Unpin for ColumnInfo
impl UnwindSafe for ColumnInfo
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>,