Skip to main content

FromColumnRef

Trait FromColumnRef 

Source
pub trait FromColumnRef<'r>: Sized {
    // Required method
    fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<Self, Error>;
}
Expand description

Decodes one column directly from a borrowed row.

This is the trait behind RowRef::get. Most types do not need to implement it manually because many implementations can go through Decode.

Implementors may borrow from row, so the returned value must not outlive 'r.

Required Methods§

Source

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<Self, Error>

Decodes the column at index.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'r> FromColumnRef<'r> for &'r str

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<&'r str, Error>

Source§

impl<'r> FromColumnRef<'r> for &'r [u8]

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<&'r [u8], Error>

Source§

impl<'r> FromColumnRef<'r> for bool

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<bool, Error>

Source§

impl<'r> FromColumnRef<'r> for f64

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<f64, Error>

Source§

impl<'r> FromColumnRef<'r> for i64

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<i64, Error>

Source§

impl<'r> FromColumnRef<'r> for u64

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<u64, Error>

Source§

impl<'r> FromColumnRef<'r> for String

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<String, Error>

Source§

impl<'r> FromColumnRef<'r> for Vec<u8>

Source§

fn from_column_ref(row: &'r RowRef<'r>, index: usize) -> Result<Vec<u8>, Error>

Implementors§