[−][src]Trait tiberius::FromSql
A conversion trait from a TDS type by-reference.
A FromSql
implementation for a Rust type is needed for using it as a
return parameter from Row#get
or Row#try_get
methods. The following
Rust types are already implemented to match the given server types:
Rust type | Server type |
---|---|
u8 | tinyint |
i16 | smallint |
i32 | int |
i64 | bigint |
f32 | float(24) |
f64 | float(53) |
bool | bit |
String /&str | nvarchar /varchar /nchar /char /ntext /text |
Vec<u8> /&[u8] | binary /varbinary /image |
Uuid | uniqueidentifier |
Numeric | numeric /decimal |
Decimal (with feature flag rust_decimal ) | numeric /decimal |
XmlData | xml |
NaiveDateTime (with feature flag chrono ) | datetime /datetime2 /smalldatetime |
NaiveDate (with feature flag chrono ) | date |
NaiveTime (with feature flag chrono ) | time |
DateTime (with feature flag chrono ) | datetimeoffset |
See the time
module for more information about the date and time structs.
Required methods
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
Returns the value, None
being a null value, copying the value.
Implementations on Foreign Types
impl<'a> FromSql<'a> for bool
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for u8
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for f32
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for f64
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for i32
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for i16
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for i64
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for &'a str
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for &'a [u8]
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
Implementors
impl<'a> FromSql<'a> for &'a XmlData
[src]
pub fn from_sql(value: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for BigDecimal
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for Decimal
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for Numeric
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for Uuid
[src]
pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for DateTime<FixedOffset>
[src]
This is supported on crate feature
chrono
only.pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for DateTime<Utc>
[src]
This is supported on crate feature
chrono
only.pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for NaiveDate
[src]
This is supported on crate feature
chrono
only.pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for NaiveDateTime
[src]
This is supported on crate feature
chrono
only.pub fn from_sql(data: &'a ColumnData<'static>) -> Result<Option<Self>>
[src]
impl<'a> FromSql<'a> for NaiveTime
[src]
This is supported on crate feature
chrono
only.