Struct tidb_query_datatype::codec::mysql::duration::Duration [−][src]
Fields
nanos: i64
fsp: u8
Implementations
impl Duration
[src]
pub fn is_neg(self) -> bool
[src]
pub fn hours(self) -> u32
[src]
pub fn minutes(self) -> u32
[src]
pub fn secs(self) -> u32
[src]
pub fn subsec_micros(self) -> u32
[src]
Returns the fractional part of Duration
in microseconds.
pub fn subsec_nanos(self) -> u32
[src]
Returns the fractional part of Duration
in nanoseconds.
pub fn fsp(self) -> u8
[src]
pub fn minimize_fsp(self) -> Self
[src]
pub fn maximize_fsp(self) -> Self
[src]
pub fn to_secs(self) -> i64
[src]
pub fn to_secs_f64(self) -> f64
[src]
Returns the number of seconds contained by this Duration as f64. The returned value does include the fractional (nanosecond) part of the duration.
pub fn to_millis(self) -> i64
[src]
pub fn to_micros(self) -> i64
[src]
pub fn to_nanos(self) -> i64
[src]
pub fn zero() -> Duration
[src]
Returns the identity element of Duration
pub fn is_zero(self) -> bool
[src]
Returns true if self is equal to the additive identity.
pub fn abs(self) -> Self
[src]
Returns the absolute value of Duration
pub fn from_secs(secs: i64, fsp: i8) -> Result<Duration>
[src]
pub fn from_millis(millis: i64, fsp: i8) -> Result<Duration>
[src]
pub fn from_micros(micros: i64, fsp: i8) -> Result<Duration>
[src]
pub fn from_nanos(nanos: i64, fsp: i8) -> Result<Duration>
[src]
pub fn new_from_parts(
neg: bool,
hour: u32,
minute: u32,
second: u32,
nanos: u32,
fsp: i8
) -> Result<Duration>
[src]
neg: bool,
hour: u32,
minute: u32,
second: u32,
nanos: u32,
fsp: i8
) -> Result<Duration>
pub fn parse(ctx: &mut EvalContext, input: &str, fsp: i8) -> Result<Duration>
[src]
Parses the time from a formatted string with a fractional seconds part,
returns the duration type Time
value.
See: http://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html
pub fn parse_consider_overflow(
ctx: &mut EvalContext,
input: &str,
fsp: i8,
overflow_as_null: bool
) -> Result<Duration>
[src]
ctx: &mut EvalContext,
input: &str,
fsp: i8,
overflow_as_null: bool
) -> Result<Duration>
pub fn parse_exactly(
ctx: &mut EvalContext,
input: &str,
fsp: i8
) -> Result<Duration>
[src]
ctx: &mut EvalContext,
input: &str,
fsp: i8
) -> Result<Duration>
Parses the input exactly as duration and will not fallback to datetime.
pub fn round_frac(self, fsp: i8) -> Result<Self>
[src]
Rounds fractional seconds precision with new FSP and returns a new one. We will use the “round half up” rule, e.g, >= 0.5 -> 1, < 0.5 -> 0, so 10:10:10.999999 round with fsp: 1 -> 10:10:11.0 and 10:10:10.000000 round with fsp: 0 -> 10:10:11
pub fn checked_add(self, rhs: Duration) -> Option<Duration>
[src]
Checked duration addition. Computes self + rhs, returning None if overflow occurred.
pub fn checked_sub(self, rhs: Duration) -> Option<Duration>
[src]
Checked duration subtraction. Computes self - rhs, returning None if overflow occurred.
fn format(self, sep: &str) -> String
[src]
pub fn to_numeric_string(self) -> String
[src]
Converts a Duration
to printable numeric string representation
pub fn from_i64(ctx: &mut EvalContext, n: i64, fsp: i8) -> Result<Duration>
[src]
Trait Implementations
impl AsMySQLBool for Duration
[src]
fn as_mysql_bool(&self, _context: &mut EvalContext) -> Result<bool>
[src]
impl Clone for Duration
[src]
impl ConvertTo<Decimal> for Duration
[src]
fn convert(&self, _: &mut EvalContext) -> Result<Decimal>
[src]
This function should not return err, if it return err, then the err is because of bug.
Port from TiDB’ Duration::ToNumber
impl ConvertTo<Duration> for Time
[src]
fn convert(&self, _: &mut EvalContext) -> Result<Duration>
[src]
Port from TiDB’s Time::ConvertToDuration
impl ConvertTo<Json> for Duration
[src]
fn convert(&self, _: &mut EvalContext) -> Result<Json>
[src]
impl ConvertTo<f64> for Duration
[src]
fn convert(&self, _: &mut EvalContext) -> Result<f64>
[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl Display for Duration
[src]
impl Eq for Duration
[src]
impl Evaluable for Duration
[src]
const EVAL_TYPE: EvalType
[src]
fn borrow_scalar_value(v: &ScalarValue) -> Option<&Self>
[src]
fn borrow_scalar_value_ref<'a>(v: ScalarValueRef<'a>) -> Option<&'a Self>
[src]
fn borrow_vector_value(v: &VectorValue) -> &ChunkedVecSized<Duration>
[src]
impl EvaluableRet for Duration
[src]
const EVAL_TYPE: EvalType
[src]
type ChunkedType = ChunkedVecSized<Self>
fn cast_chunk_into_vector_value(vec: ChunkedVecSized<Self>) -> VectorValue
[src]
impl From<Duration> for ScalarValue
[src]
fn from(s: Duration) -> ScalarValue
[src]
impl From<Duration> for Datum
[src]
impl Hash for Duration
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Duration
[src]
fn cmp(&self, rhs: &Duration) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Duration> for Duration
[src]
impl PartialOrd<Duration> for Duration
[src]
fn partial_cmp(&self, rhs: &Duration) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> RawDatumDecoder<Duration> for &'a [u8]
[src]
impl ToInt for Duration
[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 VectorValueExt<Duration> for VectorValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src]
W: ConvertTo<V>,
pub fn convert_from(&mut EvalContext, W) -> Result<V, Error>
[src]
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,
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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,