Trait tidb_query_datatype::codec::convert::ConvertTo [−][src]
A trait for converting a value to T
Required methods
fn convert(&self, ctx: &mut EvalContext) -> Result<T>
[src][−]
Converts the given value to T
value
Implementations on Foreign Types
impl ConvertTo<f64> for i64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<f64>
[src]
impl ConvertTo<f64> for u64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<f64>
[src]
impl ConvertTo<f64> for &[u8]
[src][−]
fn convert(&self, ctx: &mut EvalContext) -> Result<f64>
[src][−]
This function parse the str to float, if the num represent by the str is too large, it will handle truncated using ctx, and return f64::MIN or f64::MAX according to whether isNeg of the str
Port from TiDB’s types.StrToFloat
impl ConvertTo<f64> for Cow<'_, [u8]>
[src][−]
fn convert(&self, ctx: &mut EvalContext) -> Result<f64>
[src]
impl ConvertTo<Decimal> for i64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<Decimal>
[src]
impl ConvertTo<Decimal> for u64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<Decimal>
[src]
impl ConvertTo<Decimal> for f64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<Decimal>
[src][−]
Convert a float number to decimal.
This function will use float’s canonical string representation rather than the accurate value the float represent.
impl ConvertTo<Decimal> for &[u8]
[src][−]
fn convert(&self, ctx: &mut EvalContext) -> Result<Decimal>
[src]
impl ConvertTo<Decimal> for Cow<'_, [u8]>
[src][−]
fn convert(&self, ctx: &mut EvalContext) -> Result<Decimal>
[src]
impl ConvertTo<Json> for i64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<Json>
[src]
impl ConvertTo<Json> for f64
[src][−]
fn convert(&self, _: &mut EvalContext) -> Result<Json>
[src]
Implementors
impl ConvertTo<f64> for Decimal
[src][+]
impl ConvertTo<f64> for Duration
[src][+]
impl ConvertTo<f64> for Json
[src][+]
impl ConvertTo<f64> for Time
[src][+]
impl ConvertTo<f64> for Bytes
[src][+]
impl ConvertTo<Decimal> for Duration
[src][+]
impl ConvertTo<Decimal> for Json
[src][+]
impl ConvertTo<Decimal> for Time
[src][+]
impl ConvertTo<Decimal> for Bytes
[src][+]
impl ConvertTo<Decimal> for Real
[src][+]
impl ConvertTo<Duration> for Time
[src][+]
impl ConvertTo<Json> for Decimal
[src][+]
impl ConvertTo<Json> for Duration
[src][+]
impl ConvertTo<Json> for Time
[src][+]
impl ConvertTo<Json> for Real
[src][+]
impl<'a> ConvertTo<f64> for JsonRef<'a>
[src][+]
impl<'a> ConvertTo<NotNan<f64>> for JsonRef<'a>
[src][+]
impl<'a> ConvertTo<Decimal> for JsonRef<'a>
[src][+]
impl<'a> ConvertTo<String> for JsonRef<'a>
[src][+]
impl<'a> ConvertTo<Vec<u8, Global>> for EnumRef<'a>
[src][+]
impl<'a> ConvertTo<Vec<u8, Global>> for JsonRef<'a>
[src][+]
impl<T> ConvertTo<i64> for T where
T: ToInt,
[src][+]
T: ToInt,
impl<T> ConvertTo<u64> for T where
T: ToInt,
[src][+]
T: ToInt,
impl<T> ConvertTo<NotNan<f64>> for T where
T: ConvertTo<f64> + EvaluableRet,
[src][+]
T: ConvertTo<f64> + EvaluableRet,
impl<T> ConvertTo<String> for T where
T: ToString + EvaluableRet,
[src][+]
T: ToString + EvaluableRet,
impl<T> ConvertTo<Vec<u8, Global>> for T where
T: ToString + EvaluableRet,
[src][+]
T: ToString + EvaluableRet,