#[non_exhaustive]pub enum TvpWireType {
Show 17 variants
Bit,
Int {
size: u8,
},
Float {
size: u8,
},
Decimal {
precision: u8,
scale: u8,
},
NVarChar {
max_length: u16,
},
VarChar {
max_length: u16,
},
VarBinary {
max_length: u16,
},
Guid,
Date,
Time {
scale: u8,
},
DateTime2 {
scale: u8,
},
DateTimeOffset {
scale: u8,
},
Money,
SmallMoney,
DateTime,
SmallDateTime,
Xml,
}Expand description
TVP column type for wire encoding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bit
BIT type.
Int
Integer type with size (1, 2, 4, or 8 bytes).
Float
Floating point type with size (4 or 8 bytes).
Decimal
Decimal/Numeric type.
NVarChar
Unicode string (NVARCHAR).
VarChar
ASCII string (VARCHAR).
VarBinary
Binary data (VARBINARY).
Guid
UNIQUEIDENTIFIER (UUID).
Date
DATE type.
Time
TIME type with scale.
DateTime2
DATETIME2 type with scale.
DateTimeOffset
DATETIMEOFFSET type with scale.
Money
MONEY type (8-byte scaled integer, scale 4 implicit, via MONEYN / 0x6E).
SmallMoney
SMALLMONEY type (4-byte scaled integer, scale 4 implicit, via MONEYN / 0x6E).
DateTime
Legacy DATETIME type (8 bytes: days since 1900 + 1/300s ticks, via DATETIMEN / 0x6F).
SmallDateTime
SMALLDATETIME type (4 bytes: days since 1900 + minutes, via DATETIMEN / 0x6F).
Xml
XML type.
Implementations§
Source§impl TvpWireType
impl TvpWireType
Sourcepub fn encode_type_info(&self, buf: &mut BytesMut)
pub fn encode_type_info(&self, buf: &mut BytesMut)
Encode the TYPE_INFO for this column type.
String columns are declared with the default Latin1_General_CI_AS
collation; use encode_type_info_with_collation
to declare the server’s actual collation.
Sourcepub fn encode_type_info_with_collation(
&self,
buf: &mut BytesMut,
collation: Option<&Collation>,
)
pub fn encode_type_info_with_collation( &self, buf: &mut BytesMut, collation: Option<&Collation>, )
Encode the TYPE_INFO for this column type, declaring collation for
string columns.
The collation declared here tells the server which codepage VARCHAR
cell bytes are in. It must match the encoding used for the cell data
(see encode_tvp_varchar_with_collation). None falls back to
DEFAULT_COLLATION (Latin1_General_CI_AS / Windows-1252).
Trait Implementations§
Source§impl Clone for TvpWireType
impl Clone for TvpWireType
Source§fn clone(&self) -> TvpWireType
fn clone(&self) -> TvpWireType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TvpWireType
Source§impl Debug for TvpWireType
impl Debug for TvpWireType
impl Eq for TvpWireType
Source§impl PartialEq for TvpWireType
impl PartialEq for TvpWireType
Source§fn eq(&self, other: &TvpWireType) -> bool
fn eq(&self, other: &TvpWireType) -> bool
self and other values to be equal, and is used by ==.