Struct odbc_api::buffers::BinColumn

source ·
pub struct BinColumn { /* private fields */ }
Expand description

A buffer intended to be bound to a column of a cursor. Elements of the buffer will contain a variable amount of bytes up to a maximum length. Since elements of this type have variable length an additional indicator buffer is also maintained, whether the column is nullable or not. Therefore this buffer type is used for variable sized binary data whether it is nullable or not.

Implementations§

This will allocate a value and indicator buffer for batch_size elements. Each value may have a maximum length of element_size. Uses a fallibale allocation for creating the buffer. In applications often the element_size of the buffer, might be directly inspired by the maximum size of the type, as reported, by ODBC. Which might get exceedingly large for types like VARBINARY(MAX), or IMAGE. On the downside, this method is potentially slower than new.

Examples found in repository?
src/buffers/any_buffer.rs (line 86)
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
    fn impl_from_desc(
        max_rows: usize,
        desc: BufferDesc,
        fallible_allocations: bool,
    ) -> Result<Self, TooLargeBufferSize> {
        let buffer = match desc {
            BufferDesc::Binary { length } => {
                if fallible_allocations {
                    AnyBuffer::Binary(BinColumn::try_new(max_rows, length)?)
                } else {
                    AnyBuffer::Binary(BinColumn::new(max_rows, length))
                }
            }
            BufferDesc::Text { max_str_len } => {
                if fallible_allocations {
                    AnyBuffer::Text(TextColumn::try_new(max_rows, max_str_len)?)
                } else {
                    AnyBuffer::Text(TextColumn::new(max_rows, max_str_len))
                }
            }
            BufferDesc::WText { max_str_len } => {
                if fallible_allocations {
                    AnyBuffer::WText(TextColumn::try_new(max_rows, max_str_len)?)
                } else {
                    AnyBuffer::WText(TextColumn::new(max_rows, max_str_len))
                }
            }
            BufferDesc::Date { nullable: false } => {
                AnyBuffer::Date(vec![Date::default(); max_rows])
            }
            BufferDesc::Time { nullable: false } => {
                AnyBuffer::Time(vec![Time::default(); max_rows])
            }
            BufferDesc::Timestamp { nullable: false } => {
                AnyBuffer::Timestamp(vec![Timestamp::default(); max_rows])
            }
            BufferDesc::F64 { nullable: false } => AnyBuffer::F64(vec![f64::default(); max_rows]),
            BufferDesc::F32 { nullable: false } => AnyBuffer::F32(vec![f32::default(); max_rows]),
            BufferDesc::I8 { nullable: false } => AnyBuffer::I8(vec![i8::default(); max_rows]),
            BufferDesc::I16 { nullable: false } => AnyBuffer::I16(vec![i16::default(); max_rows]),
            BufferDesc::I32 { nullable: false } => AnyBuffer::I32(vec![i32::default(); max_rows]),
            BufferDesc::I64 { nullable: false } => AnyBuffer::I64(vec![i64::default(); max_rows]),
            BufferDesc::U8 { nullable: false } => AnyBuffer::U8(vec![u8::default(); max_rows]),
            BufferDesc::Bit { nullable: false } => AnyBuffer::Bit(vec![Bit::default(); max_rows]),
            BufferDesc::Date { nullable: true } => {
                AnyBuffer::NullableDate(OptDateColumn::new(max_rows))
            }
            BufferDesc::Time { nullable: true } => {
                AnyBuffer::NullableTime(OptTimeColumn::new(max_rows))
            }
            BufferDesc::Timestamp { nullable: true } => {
                AnyBuffer::NullableTimestamp(OptTimestampColumn::new(max_rows))
            }
            BufferDesc::F64 { nullable: true } => {
                AnyBuffer::NullableF64(OptF64Column::new(max_rows))
            }
            BufferDesc::F32 { nullable: true } => {
                AnyBuffer::NullableF32(OptF32Column::new(max_rows))
            }
            BufferDesc::I8 { nullable: true } => AnyBuffer::NullableI8(OptI8Column::new(max_rows)),
            BufferDesc::I16 { nullable: true } => {
                AnyBuffer::NullableI16(OptI16Column::new(max_rows))
            }
            BufferDesc::I32 { nullable: true } => {
                AnyBuffer::NullableI32(OptI32Column::new(max_rows))
            }
            BufferDesc::I64 { nullable: true } => {
                AnyBuffer::NullableI64(OptI64Column::new(max_rows))
            }
            BufferDesc::U8 { nullable: true } => AnyBuffer::NullableU8(OptU8Column::new(max_rows)),
            BufferDesc::Bit { nullable: true } => {
                AnyBuffer::NullableBit(OptBitColumn::new(max_rows))
            }
        };
        Ok(buffer)
    }

This will allocate a value and indicator buffer for batch_size elements. Each value may have a maximum length of max_len.

Examples found in repository?
src/buffers/any_buffer.rs (line 88)
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
    fn impl_from_desc(
        max_rows: usize,
        desc: BufferDesc,
        fallible_allocations: bool,
    ) -> Result<Self, TooLargeBufferSize> {
        let buffer = match desc {
            BufferDesc::Binary { length } => {
                if fallible_allocations {
                    AnyBuffer::Binary(BinColumn::try_new(max_rows, length)?)
                } else {
                    AnyBuffer::Binary(BinColumn::new(max_rows, length))
                }
            }
            BufferDesc::Text { max_str_len } => {
                if fallible_allocations {
                    AnyBuffer::Text(TextColumn::try_new(max_rows, max_str_len)?)
                } else {
                    AnyBuffer::Text(TextColumn::new(max_rows, max_str_len))
                }
            }
            BufferDesc::WText { max_str_len } => {
                if fallible_allocations {
                    AnyBuffer::WText(TextColumn::try_new(max_rows, max_str_len)?)
                } else {
                    AnyBuffer::WText(TextColumn::new(max_rows, max_str_len))
                }
            }
            BufferDesc::Date { nullable: false } => {
                AnyBuffer::Date(vec![Date::default(); max_rows])
            }
            BufferDesc::Time { nullable: false } => {
                AnyBuffer::Time(vec![Time::default(); max_rows])
            }
            BufferDesc::Timestamp { nullable: false } => {
                AnyBuffer::Timestamp(vec![Timestamp::default(); max_rows])
            }
            BufferDesc::F64 { nullable: false } => AnyBuffer::F64(vec![f64::default(); max_rows]),
            BufferDesc::F32 { nullable: false } => AnyBuffer::F32(vec![f32::default(); max_rows]),
            BufferDesc::I8 { nullable: false } => AnyBuffer::I8(vec![i8::default(); max_rows]),
            BufferDesc::I16 { nullable: false } => AnyBuffer::I16(vec![i16::default(); max_rows]),
            BufferDesc::I32 { nullable: false } => AnyBuffer::I32(vec![i32::default(); max_rows]),
            BufferDesc::I64 { nullable: false } => AnyBuffer::I64(vec![i64::default(); max_rows]),
            BufferDesc::U8 { nullable: false } => AnyBuffer::U8(vec![u8::default(); max_rows]),
            BufferDesc::Bit { nullable: false } => AnyBuffer::Bit(vec![Bit::default(); max_rows]),
            BufferDesc::Date { nullable: true } => {
                AnyBuffer::NullableDate(OptDateColumn::new(max_rows))
            }
            BufferDesc::Time { nullable: true } => {
                AnyBuffer::NullableTime(OptTimeColumn::new(max_rows))
            }
            BufferDesc::Timestamp { nullable: true } => {
                AnyBuffer::NullableTimestamp(OptTimestampColumn::new(max_rows))
            }
            BufferDesc::F64 { nullable: true } => {
                AnyBuffer::NullableF64(OptF64Column::new(max_rows))
            }
            BufferDesc::F32 { nullable: true } => {
                AnyBuffer::NullableF32(OptF32Column::new(max_rows))
            }
            BufferDesc::I8 { nullable: true } => AnyBuffer::NullableI8(OptI8Column::new(max_rows)),
            BufferDesc::I16 { nullable: true } => {
                AnyBuffer::NullableI16(OptI16Column::new(max_rows))
            }
            BufferDesc::I32 { nullable: true } => {
                AnyBuffer::NullableI32(OptI32Column::new(max_rows))
            }
            BufferDesc::I64 { nullable: true } => {
                AnyBuffer::NullableI64(OptI64Column::new(max_rows))
            }
            BufferDesc::U8 { nullable: true } => AnyBuffer::NullableU8(OptU8Column::new(max_rows)),
            BufferDesc::Bit { nullable: true } => {
                AnyBuffer::NullableBit(OptBitColumn::new(max_rows))
            }
        };
        Ok(buffer)
    }

Return the value for the given row index.

The column buffer does not know how many elements were in the last row group, and therefore can not guarantee the accessed element to be valid and in a defined state. It also can not panic on accessing an undefined element. It will panic however if row_index is larger or equal to the maximum number of elements in the buffer.

Examples found in repository?
src/buffers/bin_column.rs (line 328)
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
    pub fn get(&self, index: usize) -> Option<&'c [u8]> {
        self.col.value_at(index)
    }

    /// Iterator over the valid elements of the text buffer
    pub fn iter(&self) -> BinColumnIt<'c> {
        BinColumnIt {
            pos: 0,
            num_rows: self.num_rows,
            col: self.col,
        }
    }
}

/// Iterator over a binary column. See [`crate::buffers::AnyColumnView`]
#[derive(Debug)]
pub struct BinColumnIt<'c> {
    pos: usize,
    num_rows: usize,
    col: &'c BinColumn,
}

impl<'c> Iterator for BinColumnIt<'c> {
    type Item = Option<&'c [u8]>;

    fn next(&mut self) -> Option<Self::Item> {
        if self.pos == self.num_rows {
            None
        } else {
            let ret = Some(self.col.value_at(self.pos));
            self.pos += 1;
            ret
        }
    }

Indicator value at the specified position. Useful to detect truncation of data.

The column buffer does not know how many elements were in the last row group, and therefore can not guarantee the accessed element to be valid and in a defined state. It also can not panic on accessing an undefined element. It will panic however if row_index is larger or equal to the maximum number of elements in the buffer.

Examples found in repository?
src/buffers/bin_column.rs (line 93)
92
93
94
95
96
97
98
99
100
101
102
    pub fn content_length_at(&self, row_index: usize) -> Option<usize> {
        match self.indicator_at(row_index) {
            Indicator::Null => None,
            // Seen no total in the wild then binding shorter buffer to fixed sized CHAR in MSSQL.
            Indicator::NoTotal => Some(self.max_len),
            Indicator::Length(length) => {
                let length = min(self.max_len, length);
                Some(length)
            }
        }
    }

Length of value at the specified position. This is different from an indicator as it refers to the length of the value in the buffer, not to the length of the value in the datasource. The two things are different for truncated values.

Examples found in repository?
src/buffers/bin_column.rs (line 73)
72
73
74
75
76
77
    pub fn value_at(&self, row_index: usize) -> Option<&[u8]> {
        self.content_length_at(row_index).map(|length| {
            let offset = row_index * self.max_len;
            &self.values[offset..offset + length]
        })
    }

Changes the maximum element length the buffer can hold. This operation is useful if you find an unexpected large input during insertion. All values in the buffer will be set to NULL.

Parameters
  • new_max_len: New maximum string length without terminating zero.

Maximum length of elements in bytes.

Examples found in repository?
src/buffers/bin_column.rs (line 296)
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
    pub fn ensure_max_element_length(
        &mut self,
        element_length: usize,
        num_rows_to_copy: usize,
    ) -> Result<(), Error> {
        // Column buffer is not large enough to hold the element. We must allocate a larger buffer
        // in order to hold it. This invalidates the pointers previously bound to the statement. So
        // we rebind them.
        if element_length > self.column.max_len() {
            self.column
                .resize_max_element_length(element_length, num_rows_to_copy);
            unsafe {
                self.stmt
                    .bind_input_parameter(self.parameter_index, self.column)
                    .into_result(&self.stmt)?
            }
        }
        Ok(())
    }

View of the first num_rows values of a binary column.

Num rows may not exceed the actually amount of valid num_rows filled be the ODBC API. The column buffer does not know how many elements were in the last row group, and therefore can not guarantee the accessed element to be valid and in a defined state. It also can not panic on accessing an undefined element. It will panic however if row_index is larger or equal to the maximum number of elements in the buffer.

Examples found in repository?
src/buffers/any_buffer.rs (line 577)
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
    fn view(&self, valid_rows: usize) -> AnySlice {
        match self {
            AnyBuffer::Binary(col) => AnySlice::Binary(col.view(valid_rows)),
            AnyBuffer::Text(col) => AnySlice::Text(col.view(valid_rows)),
            AnyBuffer::WText(col) => AnySlice::WText(col.view(valid_rows)),
            AnyBuffer::Date(col) => AnySlice::Date(&col[0..valid_rows]),
            AnyBuffer::Time(col) => AnySlice::Time(&col[0..valid_rows]),
            AnyBuffer::Timestamp(col) => AnySlice::Timestamp(&col[0..valid_rows]),
            AnyBuffer::F64(col) => AnySlice::F64(&col[0..valid_rows]),
            AnyBuffer::F32(col) => AnySlice::F32(&col[0..valid_rows]),
            AnyBuffer::I8(col) => AnySlice::I8(&col[0..valid_rows]),
            AnyBuffer::I16(col) => AnySlice::I16(&col[0..valid_rows]),
            AnyBuffer::I32(col) => AnySlice::I32(&col[0..valid_rows]),
            AnyBuffer::I64(col) => AnySlice::I64(&col[0..valid_rows]),
            AnyBuffer::U8(col) => AnySlice::U8(&col[0..valid_rows]),
            AnyBuffer::Bit(col) => AnySlice::Bit(&col[0..valid_rows]),
            AnyBuffer::NullableDate(col) => AnySlice::NullableDate(col.iter(valid_rows)),
            AnyBuffer::NullableTime(col) => AnySlice::NullableTime(col.iter(valid_rows)),
            AnyBuffer::NullableTimestamp(col) => AnySlice::NullableTimestamp(col.iter(valid_rows)),
            AnyBuffer::NullableF64(col) => AnySlice::NullableF64(col.iter(valid_rows)),
            AnyBuffer::NullableF32(col) => AnySlice::NullableF32(col.iter(valid_rows)),
            AnyBuffer::NullableI8(col) => AnySlice::NullableI8(col.iter(valid_rows)),
            AnyBuffer::NullableI16(col) => AnySlice::NullableI16(col.iter(valid_rows)),
            AnyBuffer::NullableI32(col) => AnySlice::NullableI32(col.iter(valid_rows)),
            AnyBuffer::NullableI64(col) => AnySlice::NullableI64(col.iter(valid_rows)),
            AnyBuffer::NullableU8(col) => AnySlice::NullableU8(col.iter(valid_rows)),
            AnyBuffer::NullableBit(col) => AnySlice::NullableBit(col.iter(valid_rows)),
        }
    }

Sets the value of the buffer at index to NULL or the specified bytes. This method will panic on out of bounds index, or if input holds a value which is longer than the maximum allowed element length.

Examples found in repository?
src/buffers/bin_column.rs (line 281)
280
281
282
    pub fn set_cell(&mut self, row_index: usize, element: Option<&[u8]>) {
        self.column.set_value(row_index, element)
    }

Fills the column with NULL, between From and To

Examples found in repository?
src/buffers/bin_column.rs (line 115)
110
111
112
113
114
115
116
117
118
    pub fn set_max_len(&mut self, new_max_len: usize) {
        let batch_size = self.indicators.len();
        // Allocate a new buffer large enough to hold a batch of strings with maximum length.
        let new_values = vec![0u8; new_max_len * batch_size];
        // Set all indicators to NULL
        self.fill_null(0, batch_size);
        self.values = new_values;
        self.max_len = new_max_len;
    }
More examples
Hide additional examples
src/buffers/any_buffer.rs (line 608)
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
    fn fill_default(&mut self, from: usize, to: usize) {
        match self {
            AnyBuffer::Binary(col) => col.fill_null(from, to),
            AnyBuffer::Text(col) => col.fill_null(from, to),
            AnyBuffer::WText(col) => col.fill_null(from, to),
            AnyBuffer::Date(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::Time(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::Timestamp(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::F64(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::F32(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::I8(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::I16(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::I32(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::I64(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::U8(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::Bit(col) => Self::fill_default_slice(&mut col[from..to]),
            AnyBuffer::NullableDate(col) => col.fill_null(from, to),
            AnyBuffer::NullableTime(col) => col.fill_null(from, to),
            AnyBuffer::NullableTimestamp(col) => col.fill_null(from, to),
            AnyBuffer::NullableF64(col) => col.fill_null(from, to),
            AnyBuffer::NullableF32(col) => col.fill_null(from, to),
            AnyBuffer::NullableI8(col) => col.fill_null(from, to),
            AnyBuffer::NullableI16(col) => col.fill_null(from, to),
            AnyBuffer::NullableI32(col) => col.fill_null(from, to),
            AnyBuffer::NullableI64(col) => col.fill_null(from, to),
            AnyBuffer::NullableU8(col) => col.fill_null(from, to),
            AnyBuffer::NullableBit(col) => col.fill_null(from, to),
        }
    }

Changes the maximum number of bytes per row the buffer can hold. This operation is useful if you find an unexpected large input during insertion.

This is however costly, as not only does the new buffer have to be allocated, but all values have to copied from the old to the new buffer.

This method could also be used to reduce the maximum length, which would truncate values in the process.

This method does not adjust indicator buffers as these might hold values larger than the maximum length.

Parameters
  • new_max_len: New maximum element length in bytes.
  • num_rows: Number of valid rows currently stored in this buffer.
Examples found in repository?
src/buffers/bin_column.rs (line 232)
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
    pub fn append(&mut self, index: usize, bytes: Option<&[u8]>) {
        if let Some(bytes) = bytes {
            if bytes.len() > self.max_len {
                let new_max_len = (bytes.len() as f64 * 1.2) as usize;
                self.resize_max_element_length(new_max_len, index)
            }

            let offset = index * self.max_len;
            self.values[offset..offset + bytes.len()].copy_from_slice(bytes);
            // And of course set the indicator correctly.
            self.indicators[index] = bytes.len().try_into().unwrap();
        } else {
            self.indicators[index] = NULL_DATA;
        }
    }

    /// Maximum number of elements this buffer can hold.
    pub fn capacity(&self) -> usize {
        self.indicators.len()
    }
}

unsafe impl<'a> BoundInputSlice<'a> for BinColumn {
    type SliceMut = BinColumnSliceMut<'a>;

    unsafe fn as_view_mut(
        &'a mut self,
        parameter_index: u16,
        stmt: StatementRef<'a>,
    ) -> Self::SliceMut {
        BinColumnSliceMut {
            column: self,
            stmt,
            parameter_index,
        }
    }
}

/// A view to a mutable array parameter text buffer, which allows for filling the buffer with
/// values.
pub struct BinColumnSliceMut<'a> {
    column: &'a mut BinColumn,
    // Needed to rebind the column in case of reallocation
    stmt: StatementRef<'a>,
    // Also needed to rebind the column in case of reallocation
    parameter_index: u16,
}

impl<'a> BinColumnSliceMut<'a> {
    /// Sets the value of the buffer at index at Null or the specified binary Text. This method will
    /// panic on out of bounds index, or if input holds a text which is larger than the maximum
    /// allowed element length. `element` must be specified without the terminating zero.
    pub fn set_cell(&mut self, row_index: usize, element: Option<&[u8]>) {
        self.column.set_value(row_index, element)
    }

    /// Ensures that the buffer is large enough to hold elements of `element_length`. Does nothing
    /// if the buffer is already large enough. Otherwise it will reallocate and rebind the buffer.
    /// The first `num_rows_to_copy_elements` will be copied from the old value buffer to the new
    /// one. This makes this an extremly expensive operation.
    pub fn ensure_max_element_length(
        &mut self,
        element_length: usize,
        num_rows_to_copy: usize,
    ) -> Result<(), Error> {
        // Column buffer is not large enough to hold the element. We must allocate a larger buffer
        // in order to hold it. This invalidates the pointers previously bound to the statement. So
        // we rebind them.
        if element_length > self.column.max_len() {
            self.column
                .resize_max_element_length(element_length, num_rows_to_copy);
            unsafe {
                self.stmt
                    .bind_input_parameter(self.parameter_index, self.column)
                    .into_result(&self.stmt)?
            }
        }
        Ok(())
    }

Appends a new element to the column buffer. Rebinds the buffer to increase maximum element length should the input be to large.

Parameters
  • index: Zero based index of the new row position. Must be equal to the number of rows currently in the buffer.
  • bytes: Value to store.

Maximum number of elements this buffer can hold.

Examples found in repository?
src/buffers/any_buffer.rs (line 547)
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
    fn capacity(&self) -> usize {
        match self {
            AnyBuffer::Binary(col) => col.capacity(),
            AnyBuffer::Text(col) => col.capacity(),
            AnyBuffer::WText(col) => col.capacity(),
            AnyBuffer::Date(col) => col.capacity(),
            AnyBuffer::Time(col) => col.capacity(),
            AnyBuffer::Timestamp(col) => col.capacity(),
            AnyBuffer::F64(col) => col.capacity(),
            AnyBuffer::F32(col) => col.capacity(),
            AnyBuffer::I8(col) => col.capacity(),
            AnyBuffer::I16(col) => col.capacity(),
            AnyBuffer::I32(col) => col.capacity(),
            AnyBuffer::I64(col) => col.capacity(),
            AnyBuffer::U8(col) => col.capacity(),
            AnyBuffer::Bit(col) => col.capacity(),
            AnyBuffer::NullableDate(col) => col.capacity(),
            AnyBuffer::NullableTime(col) => col.capacity(),
            AnyBuffer::NullableTimestamp(col) => col.capacity(),
            AnyBuffer::NullableF64(col) => col.capacity(),
            AnyBuffer::NullableF32(col) => col.capacity(),
            AnyBuffer::NullableI8(col) => col.capacity(),
            AnyBuffer::NullableI16(col) => col.capacity(),
            AnyBuffer::NullableI32(col) => col.capacity(),
            AnyBuffer::NullableI64(col) => col.capacity(),
            AnyBuffer::NullableU8(col) => col.capacity(),
            AnyBuffer::NullableBit(col) => col.capacity(),
        }
    }

Trait Implementations§

Intended to allow for modifying buffer contents, while leaving the bound parameter buffers valid.
Obtain a mutable view on a parameter buffer in order to change the parameter value(s) submitted when executing the statement. Read more
The identifier of the C data type of the value buffer. When it is retrieving data from the data source with fetch, the driver converts the data to this type. When it sends data to the source, the driver converts the data from this type.
Indicates the length of variable sized types. May be zero for fixed sized types. Used to determine the size or existence of input parameters.
Pointer to a value corresponding to the one described by cdata_type.
Maximum length of the type in bytes (not characters). It is required to index values in bound buffers, if more than one parameter is bound. Can be set to zero for types not bound as parameter arrays, i.e. CStr.
Indicates the length of variable sized types. May be zero for fixed sized types.
Pointer to a value corresponding to the one described by cdata_type.
Formats the value using the given formatter. Read more
The SQL data as which the parameter is bound to ODBC.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.