mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-05 01:43:48 +00:00
docs: extend documentation on Encode/Decode
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
//! Types and traits for encoding values to the database.
|
||||
//! Provides [`Encode`](trait.Encode.html) for encoding values for the database.
|
||||
|
||||
use std::mem;
|
||||
|
||||
use crate::database::{Database, HasArguments};
|
||||
@@ -48,11 +49,6 @@ impl<'q, T, DB: Database> Encode<'q, DB> for &'_ T
|
||||
where
|
||||
T: Encode<'q, DB>,
|
||||
{
|
||||
#[inline]
|
||||
fn produces(&self) -> Option<DB::TypeInfo> {
|
||||
(**self).produces()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull {
|
||||
<T as Encode<DB>>::encode_by_ref(self, buf)
|
||||
@@ -63,6 +59,11 @@ where
|
||||
<&T as Encode<DB>>::encode(self, buf)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn produces(&self) -> Option<DB::TypeInfo> {
|
||||
(**self).produces()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size_hint(&self) -> usize {
|
||||
(**self).size_hint()
|
||||
|
||||
Reference in New Issue
Block a user