Trait tidb_query_datatype::codec::convert::ToInt [−][src]
A trait for converting a value to an Int
.
Required methods
fn to_int(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<i64>
[src]
Converts the given value to an i64
fn to_uint(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<u64>
[src]
Converts the given value to an u64
Implementations on Foreign Types
impl ToInt for i64
[src]
fn to_int(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<i64>
[src]
fn to_uint(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<u64>
[src]
impl ToInt for u64
[src]
fn to_int(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<i64>
[src]
fn to_uint(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<u64>
[src]
impl ToInt for f64
[src]
fn to_int(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<i64>
[src]
This function is ported from TiDB’s types.ConvertFloatToInt,
which checks whether the number overflows the signed lower and upper boundaries of tp
Notes
It handles overflows using ctx
so that the caller would not handle it anymore.
fn to_uint(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<u64>
[src]
This function is ported from TiDB’s types.ConvertFloatToUint,
which checks whether the number overflows the unsigned upper boundaries of tp
Notes
It handles overflows using ctx
so that the caller would not handle it anymore.
impl ToInt for &[u8]
[src]
fn to_int(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<i64>
[src]
Port from TiDB’s types.StrToInt
fn to_uint(&self, ctx: &mut EvalContext, tp: FieldTypeTp) -> Result<u64>
[src]
Port from TiDB’s types.StrToUint