pub struct Column {
pub name: String,
pub index: usize,
pub type_name: String,
pub nullable: bool,
pub max_length: Option<u32>,
pub precision: Option<u8>,
pub scale: Option<u8>,
}Expand description
Column metadata describing a result set column.
Fields§
§name: StringColumn name.
index: usizeColumn index (0-based).
type_name: StringSQL type name (e.g., “INT”, “NVARCHAR”).
nullable: boolWhether the column allows NULL values.
max_length: Option<u32>Maximum length for variable-length types.
precision: Option<u8>Precision for numeric types.
scale: Option<u8>Scale for numeric types.
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(
name: impl Into<String>,
index: usize,
type_name: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, index: usize, type_name: impl Into<String>, ) -> Self
Create a new column with basic metadata.
Sourcepub fn with_nullable(self, nullable: bool) -> Self
pub fn with_nullable(self, nullable: bool) -> Self
Set whether the column is nullable.
Sourcepub fn with_max_length(self, max_length: u32) -> Self
pub fn with_max_length(self, max_length: u32) -> Self
Set the maximum length.
Sourcepub fn with_precision_scale(self, precision: u8, scale: u8) -> Self
pub fn with_precision_scale(self, precision: u8, scale: u8) -> Self
Set precision and scale for numeric types.
Sourcepub fn to_type_info(&self) -> TypeInfo
pub fn to_type_info(&self) -> TypeInfo
Convert column metadata to TDS TypeInfo for decoding.
Maps type names to TDS type IDs and constructs appropriate TypeInfo.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more