Enum tidb_query_datatype::codec::data_type::ScalarValue [−][src]
A scalar value container, a.k.a. datum, for all concrete eval types.
In many cases, for example, at the framework level, the concrete eval type is unknown at compile
time. So we use this enum container to represent types dynamically. It is similar to trait
object Box<T>
where T
is a concrete eval type but faster.
Like VectorValue
, the inner concrete value is immutable.
Compared to VectorValue
, it only contains a single concrete value.
Compared to Datum
, it is a newer encapsulation that naturally wraps Option<..>
.
TODO: Once we removed the Option<..>
wrapper, it will be much like Datum
. At that time,
we only need to preserve one of them.
Variants
Implementations
impl ScalarValue
[src]
pub fn eval_type(&self) -> EvalType
[src]
pub fn as_scalar_value_ref(&self) -> ScalarValueRef<'_>
[src]
pub fn is_none(&self) -> bool
[src]
pub fn is_some(&self) -> bool
[src]
impl ScalarValue
[src]
impl ScalarValue
[src]
impl ScalarValue
[src]
pub fn as_decimal(&self) -> Option<&Decimal>
[src]
impl ScalarValue
[src]
pub fn as_date_time(&self) -> Option<&DateTime>
[src]
impl ScalarValue
[src]
pub fn as_duration(&self) -> Option<&Duration>
[src]
impl ScalarValue
[src]
impl ScalarValue
[src]
Trait Implementations
impl AsMySQLBool for ScalarValue
[src]
fn as_mysql_bool(&self, context: &mut EvalContext) -> Result<bool>
[src]
impl Clone for ScalarValue
[src]
fn clone(&self) -> ScalarValue
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ScalarValue
[src]
impl From<Decimal> for ScalarValue
[src]
fn from(s: Decimal) -> ScalarValue
[src]
impl From<Duration> for ScalarValue
[src]
fn from(s: Duration) -> ScalarValue
[src]
impl From<Json> for ScalarValue
[src]
fn from(s: Json) -> ScalarValue
[src]
impl From<NotNan<f64>> for ScalarValue
[src]
fn from(s: Real) -> ScalarValue
[src]
impl<'a> From<Option<&'a [u8]>> for ScalarValue
[src]
fn from(s: Option<BytesRef<'a>>) -> ScalarValue
[src]
impl From<Option<Decimal>> for ScalarValue
[src]
fn from(s: Option<Decimal>) -> ScalarValue
[src]
impl From<Option<Duration>> for ScalarValue
[src]
fn from(s: Option<Duration>) -> ScalarValue
[src]
impl From<Option<Json>> for ScalarValue
[src]
fn from(s: Option<Json>) -> ScalarValue
[src]
impl<'a> From<Option<JsonRef<'a>>> for ScalarValue
[src]
fn from(s: Option<JsonRef<'a>>) -> ScalarValue
[src]
impl From<Option<NotNan<f64>>> for ScalarValue
[src]
fn from(s: Option<Real>) -> ScalarValue
[src]
impl From<Option<Time>> for ScalarValue
[src]
fn from(s: Option<DateTime>) -> ScalarValue
[src]
impl From<Option<Vec<u8, Global>>> for ScalarValue
[src]
fn from(s: Option<Bytes>) -> ScalarValue
[src]
impl From<Option<f64>> for ScalarValue
[src]
fn from(s: Option<f64>) -> ScalarValue
[src]
impl From<Option<i64>> for ScalarValue
[src]
fn from(s: Option<Int>) -> ScalarValue
[src]
impl From<Time> for ScalarValue
[src]
fn from(s: DateTime) -> ScalarValue
[src]
impl From<Vec<u8, Global>> for ScalarValue
[src]
fn from(s: Bytes) -> ScalarValue
[src]
impl From<f64> for ScalarValue
[src]
fn from(s: f64) -> ScalarValue
[src]
impl From<i64> for ScalarValue
[src]
fn from(s: Int) -> ScalarValue
[src]
impl PartialEq<ScalarValue> for ScalarValue
[src]
fn eq(&self, other: &ScalarValue) -> bool
[src]
fn ne(&self, other: &ScalarValue) -> bool
[src]
impl<'a> PartialEq<ScalarValue> for ScalarValueRef<'a>
[src]
fn eq(&self, other: &ScalarValue) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<ScalarValueRef<'a>> for ScalarValue
[src]
fn eq(&self, other: &ScalarValueRef<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for ScalarValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for ScalarValue
impl Send for ScalarValue
impl Sync for ScalarValue
impl Unpin for ScalarValue
impl UnwindSafe for ScalarValue
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> 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, 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>,