Struct tidb_query_datatype::codec::mysql::time::Time[][src]

pub struct Time(pub u64);

Implementations

impl Time[src]

fn get_year(&self) -> u32[src]

fn set_year(&mut self, value: u32)[src]

fn get_month(&self) -> u32[src]

fn set_month(&mut self, value: u32)[src]

fn get_day(&self) -> u32[src]

fn set_day(&mut self, value: u32)[src]

fn get_hour(&self) -> u32[src]

fn set_hour(&mut self, value: u32)[src]

fn get_minute(&self) -> u32[src]

fn set_minute(&mut self, value: u32)[src]

fn get_second(&self) -> u32[src]

fn set_second(&mut self, value: u32)[src]

fn get_micro(&self) -> u32[src]

fn set_micro(&mut self, value: u32)[src]

fn get_fsp_tt(&self) -> u8[src]

fn set_fsp_tt(&mut self, value: u8)[src]

impl Time[src]

pub fn hour(self) -> u32[src]

Returns the hour number from 0 to 23.

pub fn minute(self) -> u32[src]

Returns the minute number from 0 to 59.

pub fn second(self) -> u32[src]

Returns the second number from 0 to 59.

pub fn micro(self) -> u32[src]

Returns the number of microseconds since the whole second.

pub fn year(self) -> u32[src]

Returns the year number

pub fn month(self) -> u32[src]

Returns the month number

pub fn day(self) -> u32[src]

Returns the day number

pub fn period_to_month(period: u64) -> u64[src]

used to convert period to month

pub fn month_to_period(month: u64) -> u64[src]

used to convert month to period

impl Time[src]

pub fn parse(
    ctx: &mut EvalContext,
    input: &str,
    time_type: TimeType,
    fsp: i8,
    round: bool
) -> Result<Time>
[src]

pub fn parse_datetime(
    ctx: &mut EvalContext,
    input: &str,
    fsp: i8,
    round: bool
) -> Result<Time>
[src]

pub fn parse_date(ctx: &mut EvalContext, input: &str) -> Result<Time>[src]

pub fn parse_timestamp(
    ctx: &mut EvalContext,
    input: &str,
    fsp: i8,
    round: bool
) -> Result<Time>
[src]

pub fn parse_from_i64(
    ctx: &mut EvalContext,
    input: i64,
    time_type: TimeType,
    fsp: i8
) -> Result<Time>
[src]

pub fn parse_from_decimal(
    ctx: &mut EvalContext,
    input: &Decimal,
    time_type: TimeType,
    fsp: i8,
    round: bool
) -> Result<Time>
[src]

impl Time[src]

fn from_slice(
    ctx: &mut EvalContext,
    parts: &[u32],
    time_type: TimeType,
    fsp: u8
) -> Option<Self>
[src]

fn from_aligned_i64(
    ctx: &mut EvalContext,
    input: i64,
    time_type: TimeType,
    fsp: i8
) -> Result<Time>
[src]

Construct a Time via a number in format: yyyymmddhhmmss

fn into_array(self) -> [u32; 7][src]

fn try_from_chrono_datetime<T: Datelike + Timelike>(
    ctx: &mut EvalContext,
    datetime: T,
    time_type: TimeType,
    fsp: i8
) -> Result<Self>
[src]

fn try_into_chrono_datetime(self, ctx: &mut EvalContext) -> Result<DateTime<Tz>>[src]

fn try_into_chrono_naive_datetime(self) -> Result<NaiveDateTime>[src]

fn unchecked_new(config: TimeArgs) -> Self[src]

fn new(ctx: &mut EvalContext, config: TimeArgs) -> Result<Time>[src]

fn check_month_and_day(
    year: u32,
    month: u32,
    day: u32,
    allow_invalid_date: bool
) -> Result<()>
[src]

pub fn is_zero(self) -> bool[src]

pub fn zero(ctx: &mut EvalContext, fsp: i8, time_type: TimeType) -> Result<Self>[src]

pub fn is_leap_year(self) -> bool[src]

pub fn last_day_of_month(self) -> u32[src]

pub fn last_date_of_month(self) -> Option<Self>[src]

pub fn fsp(self) -> u8[src]

fn set_fsp(&mut self, fsp: u8)[src]

pub fn maximize_fsp(&mut self)[src]

pub fn minimize_fsp(&mut self)[src]

pub fn get_time_type(self) -> TimeType[src]

pub fn set_time_type(&mut self, time_type: TimeType) -> Result<()>[src]

fn set_tt(&mut self, time_type: TimeType)[src]

pub fn from_packed_u64(
    ctx: &mut EvalContext,
    value: u64,
    time_type: TimeType,
    fsp: i8
) -> Result<Time>
[src]

pub fn to_packed_u64(self, ctx: &mut EvalContext) -> Result<u64>[src]

pub fn from_duration(
    ctx: &mut EvalContext,
    duration: Duration,
    time_type: TimeType
) -> Result<Self>
[src]

pub fn from_year(
    ctx: &mut EvalContext,
    year: u32,
    fsp: i8,
    time_type: TimeType
) -> Result<Self>
[src]

pub fn round_frac(self, ctx: &mut EvalContext, fsp: i8) -> Result<Self>[src]

pub fn normalized(self, ctx: &mut EvalContext) -> Result<Self>[src]

pub fn checked_add(self, ctx: &mut EvalContext, rhs: Duration) -> Option<Time>[src]

pub fn checked_sub(self, ctx: &mut EvalContext, rhs: Duration) -> Option<Time>[src]

pub fn date_diff(self, other: Self) -> Option<i64>[src]

pub fn ordinal(self) -> i32[src]

pub fn weekday(self) -> Weekday[src]

fn write_date_format_segment(self, b: char, output: &mut String) -> Result<()>[src]

pub fn date_format(self, layout: &str) -> Result<String>[src]

pub fn to_numeric_string(self) -> String[src]

Converts a DateTime to printable string representation

pub fn parse_fsp(s: &str) -> i8[src]

pub fn invalid_zero(self) -> bool[src]

pub fn from_days(ctx: &mut EvalContext, daynr: u32) -> Result<Self>[src]

fn get_date_from_daynr(daynr: u32) -> (u32, u32, u32)[src]

Trait Implementations

impl AsMySQLBool for Time[src]

impl<T> BitRange<T> for Time where
    u64: BitRange<T>, 
[src]

impl Clone for Time[src]

impl ConvertTo<Decimal> for Time[src]

impl ConvertTo<Duration> for Time[src]

fn convert(&self, _: &mut EvalContext) -> Result<Duration>[src]

Port from TiDB’s Time::ConvertToDuration

impl ConvertTo<Json> for Time[src]

impl ConvertTo<f64> for Time[src]

fn convert(&self, _: &mut EvalContext) -> Result<f64>[src]

This function should not return err, if it return err, then the err is because of bug.

impl Copy for Time[src]

impl DateTimeExtension for Time[src]

fn days(&self) -> i32[src]

returns the day of year starting from 1. implements TiDB YearDay().

fn calc_year_week(
    &self,
    monday_first: bool,
    week_year: bool,
    first_weekday: bool
) -> (i32, i32)
[src]

returns the week of year and year. should not be called directly. when monday_first == true, Monday is considered as the first day in the week, otherwise Sunday. when week_year == true, week is from 1 to 53, otherwise from 0 to 53. when first_weekday == true, the week that contains the first ‘first-day-of-week’ is week 1, otherwise weeks are numbered according to ISO 8601:1988.

fn calc_year_week_by_week_mode(&self, week_mode: WeekMode) -> (i32, i32)[src]

returns the week of year according to week mode. should not be called directly. implements TiDB calcWeek()

fn week(&self, mode: WeekMode) -> i32[src]

returns the week of year. implements TiDB Week().

fn year_week(&self, mode: WeekMode) -> (i32, i32)[src]

returns the week of year and year. implements TiDB YearWeek().

fn abbr_day_of_month(&self) -> &'static str[src]

returns the abbreviation of the day of month.

fn day_number(&self) -> i32[src]

returns the days since 0000-00-00

fn second_number(&self) -> i64[src]

returns the seconds since 0000-00-00 00:00:00

impl Debug for Time[src]

impl Default for Time[src]

impl Display for Time[src]

impl Eq for Time[src]

impl Evaluable for DateTime[src]

impl EvaluableRet for DateTime[src]

type ChunkedType = ChunkedVecSized<Self>

impl From<Time> for ScalarValue[src]

impl From<Time> for Datum[src]

impl Hash for Time[src]

impl Ord for Time[src]

impl PartialEq<Time> for Time[src]

impl PartialOrd<Time> for Time[src]

impl<'a> RawDatumDecoder<Time> for &'a [u8][src]

impl ToInt for DateTime[src]

impl VectorValueExt<Time> for VectorValue[src]

Auto Trait Implementations

impl RefUnwindSafe for Time

impl Send for Time

impl Sync for Time

impl Unpin for Time

impl UnwindSafe for Time

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Bit for T where
    T: BitRange<u8>, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

impl<T> ConvertTo<NotNan<f64>> for T where
    T: ConvertTo<f64> + EvaluableRet
[src]

impl<T> ConvertTo<String> for T where
    T: ToString + EvaluableRet
[src]

impl<T> ConvertTo<Vec<u8, Global>> for T where
    T: ToString + EvaluableRet
[src]

impl<T> ConvertTo<i64> for T where
    T: ToInt
[src]

impl<T> ConvertTo<u64> for T where
    T: ToInt
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]