Enum Type

Source
#[repr(i32)]
pub enum Type {
Show 35 variants NullType = 0, Int8 = 257, Uint8 = 770, Int16 = 259, Uint16 = 772, Int24 = 261, Uint24 = 774, Int32 = 263, Uint32 = 776, Int64 = 265, Uint64 = 778, Float32 = 1_035, Float64 = 1_036, Timestamp = 2_061, Date = 2_062, Time = 2_063, Datetime = 2_064, Year = 785, Decimal = 18, Text = 6_163, Blob = 10_260, Varchar = 6_165, Varbinary = 10_262, Char = 6_167, Binary = 10_264, Bit = 2_073, Enum = 2_074, Set = 2_075, Tuple = 28, Geometry = 2_077, Json = 2_078, Expression = 31, Hexnum = 4_128, Hexval = 4_129, Bitnum = 4_130,
}
Expand description

Type defines the various supported data types in bind vars and query results.

Variants§

§

NullType = 0

NULL_TYPE specifies a NULL type.

§

Int8 = 257

INT8 specifies a TINYINT type. Properties: 1, IsNumber.

§

Uint8 = 770

UINT8 specifies a TINYINT UNSIGNED type. Properties: 2, IsNumber, IsUnsigned.

§

Int16 = 259

INT16 specifies a SMALLINT type. Properties: 3, IsNumber.

§

Uint16 = 772

UINT16 specifies a SMALLINT UNSIGNED type. Properties: 4, IsNumber, IsUnsigned.

§

Int24 = 261

INT24 specifies a MEDIUMINT type. Properties: 5, IsNumber.

§

Uint24 = 774

UINT24 specifies a MEDIUMINT UNSIGNED type. Properties: 6, IsNumber, IsUnsigned.

§

Int32 = 263

INT32 specifies a INTEGER type. Properties: 7, IsNumber.

§

Uint32 = 776

UINT32 specifies a INTEGER UNSIGNED type. Properties: 8, IsNumber, IsUnsigned.

§

Int64 = 265

INT64 specifies a BIGINT type. Properties: 9, IsNumber.

§

Uint64 = 778

UINT64 specifies a BIGINT UNSIGNED type. Properties: 10, IsNumber, IsUnsigned.

§

Float32 = 1_035

FLOAT32 specifies a FLOAT type. Properties: 11, IsFloat.

§

Float64 = 1_036

FLOAT64 specifies a DOUBLE or REAL type. Properties: 12, IsFloat.

§

Timestamp = 2_061

TIMESTAMP specifies a TIMESTAMP type. Properties: 13, IsQuoted.

§

Date = 2_062

DATE specifies a DATE type. Properties: 14, IsQuoted.

§

Time = 2_063

TIME specifies a TIME type. Properties: 15, IsQuoted.

§

Datetime = 2_064

DATETIME specifies a DATETIME type. Properties: 16, IsQuoted.

§

Year = 785

YEAR specifies a YEAR type. Properties: 17, IsNumber, IsUnsigned.

§

Decimal = 18

DECIMAL specifies a DECIMAL or NUMERIC type. Properties: 18, None.

§

Text = 6_163

TEXT specifies a TEXT type. Properties: 19, IsQuoted, IsText.

§

Blob = 10_260

BLOB specifies a BLOB type. Properties: 20, IsQuoted, IsBinary.

§

Varchar = 6_165

VARCHAR specifies a VARCHAR type. Properties: 21, IsQuoted, IsText.

§

Varbinary = 10_262

VARBINARY specifies a VARBINARY type. Properties: 22, IsQuoted, IsBinary.

§

Char = 6_167

CHAR specifies a CHAR type. Properties: 23, IsQuoted, IsText.

§

Binary = 10_264

BINARY specifies a BINARY type. Properties: 24, IsQuoted, IsBinary.

§

Bit = 2_073

BIT specifies a BIT type. Properties: 25, IsQuoted.

§

Enum = 2_074

ENUM specifies an ENUM type. Properties: 26, IsQuoted.

§

Set = 2_075

SET specifies a SET type. Properties: 27, IsQuoted.

§

Tuple = 28

TUPLE specifies a tuple. This cannot be returned in a QueryResult, but it can be sent as a bind var. Properties: 28, None.

§

Geometry = 2_077

GEOMETRY specifies a GEOMETRY type. Properties: 29, IsQuoted.

§

Json = 2_078

JSON specifies a JSON type. Properties: 30, IsQuoted.

§

Expression = 31

EXPRESSION specifies a SQL expression. This type is for internal use only. Properties: 31, None.

§

Hexnum = 4_128

HEXNUM specifies a HEXNUM type (unquoted varbinary). Properties: 32, IsText.

§

Hexval = 4_129

HEXVAL specifies a HEXVAL type (unquoted varbinary). Properties: 33, IsText.

§

Bitnum = 4_130

BITNUM specifies a base 2 binary type (unquoted varbinary). Properties: 34, IsText.

Implementations§

Source§

impl Type

Source

pub fn is_valid(value: i32) -> bool

Returns true if value is a variant of Type.

Source

pub fn from_i32(value: i32) -> Option<Type>

👎Deprecated: Use the TryFrom<i32> implementation instead

Converts an i32 to a Type, or None if value is not a valid variant.

Source§

impl Type

Source

pub fn as_str_name(&self) -> &'static str

String value of the enum field names used in the ProtoBuf definition.

The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.

Source

pub fn from_str_name(value: &str) -> Option<Self>

Creates an enum from field names used in the ProtoBuf definition.

Trait Implementations§

Source§

impl Clone for Type

Source§

fn clone(&self) -> Type

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Type

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Type

Source§

fn default() -> Type

Returns the “default value” for a type. Read more
Source§

impl From<Type> for i32

Source§

fn from(value: Type) -> i32

Converts to this type from the input type.
Source§

impl Hash for Type

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Type

Source§

fn cmp(&self, other: &Type) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Type

Source§

fn eq(&self, other: &Type) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Type

Source§

fn partial_cmp(&self, other: &Type) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<i32> for Type

Source§

type Error = DecodeError

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Type, DecodeError>

Performs the conversion.
Source§

impl Copy for Type

Source§

impl Eq for Type

Source§

impl StructuralPartialEq for Type

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl Send for Type

§

impl Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

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

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more