mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-31 22:01:27 +00:00
14 lines
332 B
Rust
14 lines
332 B
Rust
//! Types and traits for decoding values from the database.
|
|
|
|
use crate::database::Database;
|
|
use crate::value::HasRawValue;
|
|
|
|
/// A type that can be decoded from the database.
|
|
pub trait Decode<'de, DB>
|
|
where
|
|
Self: Sized + 'de,
|
|
DB: Database,
|
|
{
|
|
fn decode(value: <DB as HasRawValue<'de>>::RawValue) -> crate::Result<Self>;
|
|
}
|