sqlx_core::value

Trait ValueRef

Source
pub trait ValueRef<'r>: Sized {
    type Database: Database;

    // Required methods
    fn to_owned(&self) -> <Self::Database as Database>::Value;
    fn type_info(&self) -> Cow<'_, <Self::Database as Database>::TypeInfo>;
    fn is_null(&self) -> bool;
}
Expand description

A reference to a single value from the database.

Required Associated Types§

Required Methods§

Source

fn to_owned(&self) -> <Self::Database as Database>::Value

Creates an owned value from this value reference.

This is just a reference increment in PostgreSQL and MySQL and thus is O(1). In SQLite, this is a copy.

Source

fn type_info(&self) -> Cow<'_, <Self::Database as Database>::TypeInfo>

Get the type information for this value.

Source

fn is_null(&self) -> bool

Returns true if the SQL value is NULL.

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.

Implementors§