mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
feat(core): add sqlx::RawValue
This commit is contained in:
parent
163d5cb1b3
commit
6b5f37dfb1
16
sqlx-core/src/raw_value.rs
Normal file
16
sqlx-core/src/raw_value.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use std::any;
|
||||
|
||||
use crate::database::HasRawValue;
|
||||
use crate::{decode, Database, Decode, TypeDecode, TypeInfo};
|
||||
|
||||
// NOTE: Add decode() and decode_unchecked() to RawValue as provided methods
|
||||
// once Rust has lazy normalization and/or GATs.
|
||||
pub trait RawValue<'r>: Sized {
|
||||
type Database: Database;
|
||||
|
||||
/// Returns `true` if this value is the SQL `NULL`.
|
||||
fn is_null(&self) -> bool;
|
||||
|
||||
/// Returns the type information for this value.
|
||||
fn type_info(&self) -> &'r <Self::Database as Database>::TypeInfo;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user