pub trait TypeChecking: Database {
const PARAM_CHECKING: ParamChecking;
// Required methods
fn param_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>;
fn return_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>;
fn get_feature_gate(info: &Self::TypeInfo) -> Option<&'static str>;
fn fmt_value_debug(value: &<Self as Database>::Value) -> FmtValue<'_, Self>;
}
Expand description
Type-checking extensions for the Database
trait.
Mostly supporting code for the macros, and for Debug
impls.
Required Associated Constants§
Sourceconst PARAM_CHECKING: ParamChecking
const PARAM_CHECKING: ParamChecking
Describes how the database in question typechecks query parameters.
Required Methods§
Sourcefn param_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>
fn param_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>
Get the full path of the Rust type that corresponds to the given TypeInfo
, if applicable.
If the type has a borrowed equivalent suitable for query parameters, this is that borrowed type.
Sourcefn return_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>
fn return_type_for_id(id: &Self::TypeInfo) -> Option<&'static str>
Get the full path of the Rust type that corresponds to the given TypeInfo
, if applicable.
Always returns the owned version of the type, suitable for decoding from Row
.
Sourcefn get_feature_gate(info: &Self::TypeInfo) -> Option<&'static str>
fn get_feature_gate(info: &Self::TypeInfo) -> Option<&'static str>
Get the name of the Cargo feature gate that must be enabled to process the given TypeInfo
,
if applicable.
Sourcefn fmt_value_debug(value: &<Self as Database>::Value) -> FmtValue<'_, Self>
fn fmt_value_debug(value: &<Self as Database>::Value) -> FmtValue<'_, Self>
If value
is a well-known type, decode and format it using Debug
.
If value
is not a well-known type or could not be decoded, the reason is printed instead.
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.