Struct Column

Source
pub struct Column { /* private fields */ }
Expand description

A single value returned from a query.

SQLite automatically converts between data types on request, which is why many of the methods require &mut.

Implementations§

Source§

impl Column

Source

pub fn name(&self) -> Result<&str>

Returns the value of the AS clause for this column, if one was specified. If no AS clause was specified, the name of the column is unspecified and may change from one release of SQLite to the next.

Source

pub fn database_name(&self) -> Result<Option<&str>>

Returns the original, unaliased name of the database that is the origin of this column.

Source

pub fn table_name(&self) -> Result<Option<&str>>

Returns the original, unaliased name of the table that is the origin of this column.

Source

pub fn origin_name(&self) -> Result<Option<&str>>

Returns the original, unaliased name of the column that is the origin of this column.

Source

pub fn decltype(&self) -> Result<Option<&str>>

Returns the declared type of the column that is the origin of this column. Note that this does not mean that values contained in this column comply with the declared type.

Trait Implementations§

Source§

impl AsMut<ValueRef> for Column

Source§

fn as_mut(&mut self) -> &mut ValueRef

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<ValueRef> for Column

Source§

fn as_ref(&self) -> &ValueRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for Column

Source§

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

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

impl FromValue for Column

Source§

fn value_type(&self) -> ValueType

Returns the data type of the ValueRef. Note that calling get methods on the ValueRef may cause a conversion to a different data type, but this is not guaranteed.
Source§

fn get_i32(&self) -> i32

Interpret this value as i32.
Source§

fn get_i64(&self) -> i64

Interpret this value as i64.
Source§

fn get_f64(&self) -> f64

Interpret this value as f64.
Source§

unsafe fn get_blob_unchecked(&self) -> &[u8]

Get the bytes of this BLOB value. Read more
Source§

fn get_blob(&mut self) -> Result<&[u8]>

Interpret this value as a BLOB.
Source§

fn is_null(&self) -> bool

Convenience method equivalent to self.value_type() == ValueType::Null.
Source§

fn try_get_blob(&self) -> Result<&[u8]>

Attempt to interpret this value as a BLOB, without converting. If the underlying data type is not a BLOB, this function will fail with Err(SQLITE_MISMATCH).
Source§

unsafe fn get_str_unchecked(&self) -> Result<&str>

Get the underlying TEXT value. Read more
Source§

fn get_str(&mut self) -> Result<&str>

Interpret the value as TEXT. Read more
Source§

fn try_get_str(&self) -> Result<&str>

Attempt to interpret this value as TEXT, without converting. If the underlying data type is not TEXT, this function will fail with Err(SQLITE_MISMATCH). This function can also fail if the string has invalid UTF-8.
Source§

fn to_owned(&self) -> Result<Value>

Clone the value, returning a Value.

Auto Trait Implementations§

§

impl Freeze for Column

§

impl RefUnwindSafe for Column

§

impl !Send for Column

§

impl !Sync for Column

§

impl Unpin for Column

§

impl UnwindSafe for Column

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.