odbc_api::buffers

Enum AnyBuffer

Source
pub enum AnyBuffer {
Show 25 variants Binary(BinColumn), Text(CharColumn), WText(WCharColumn), Date(Vec<Date>), Time(Vec<Time>), Timestamp(Vec<Timestamp>), F64(Vec<f64>), F32(Vec<f32>), I8(Vec<i8>), I16(Vec<i16>), I32(Vec<i32>), I64(Vec<i64>), U8(Vec<u8>), Bit(Vec<Bit>), NullableDate(ColumnWithIndicator<Date>), NullableTime(ColumnWithIndicator<Time>), NullableTimestamp(ColumnWithIndicator<Timestamp>), NullableF64(ColumnWithIndicator<f64>), NullableF32(ColumnWithIndicator<f32>), NullableI8(ColumnWithIndicator<i8>), NullableI16(ColumnWithIndicator<i16>), NullableI32(ColumnWithIndicator<i32>), NullableI64(ColumnWithIndicator<i64>), NullableU8(ColumnWithIndicator<u8>), NullableBit(ColumnWithIndicator<Bit>),
}
Expand description

Buffer holding a single column of either a result set or paramater

Variants§

§

Binary(BinColumn)

A buffer for holding both nullable and required binary data.

§

Text(CharColumn)

A buffer for holding both nullable and required text data. Uses the system encoding for character data.

§

WText(WCharColumn)

A buffer for holding both nullable and required text data. Uses UTF-16 encoding

§

Date(Vec<Date>)

§

Time(Vec<Time>)

§

Timestamp(Vec<Timestamp>)

§

F64(Vec<f64>)

§

F32(Vec<f32>)

§

I8(Vec<i8>)

§

I16(Vec<i16>)

§

I32(Vec<i32>)

§

I64(Vec<i64>)

§

U8(Vec<u8>)

§

Bit(Vec<Bit>)

§

NullableDate(ColumnWithIndicator<Date>)

§

NullableTime(ColumnWithIndicator<Time>)

§

NullableTimestamp(ColumnWithIndicator<Timestamp>)

§

NullableF64(ColumnWithIndicator<f64>)

§

NullableF32(ColumnWithIndicator<f32>)

§

NullableI8(ColumnWithIndicator<i8>)

§

NullableI16(ColumnWithIndicator<i16>)

§

NullableI32(ColumnWithIndicator<i32>)

§

NullableI64(ColumnWithIndicator<i64>)

§

NullableU8(ColumnWithIndicator<u8>)

§

NullableBit(ColumnWithIndicator<Bit>)

Implementations§

Source§

impl AnyBuffer

Source

pub fn try_from_desc( max_rows: usize, desc: BufferDesc, ) -> Result<Self, TooLargeBufferSize>

Map buffer description to actual buffer.

Source

pub fn from_desc(max_rows: usize, desc: BufferDesc) -> Self

Map buffer description to actual buffer.

Trait Implementations§

Source§

impl<'a> BoundInputSlice<'a> for AnyBuffer

Source§

type SliceMut = AnySliceMut<'a>

Intended to allow for modifying buffer contents, while leaving the bound parameter buffers valid.
Source§

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

Obtain a mutable view on a parameter buffer in order to change the parameter value(s) submitted when executing the statement. Read more
Source§

impl CData for AnyBuffer

Source§

fn cdata_type(&self) -> CDataType

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.
Source§

fn indicator_ptr(&self) -> *const isize

Indicates the length of variable sized types. May be zero for fixed sized types. Used to determine the size or existence of input parameters.
Source§

fn value_ptr(&self) -> *const c_void

Pointer to a value corresponding to the one described by cdata_type.
Source§

fn buffer_length(&self) -> isize

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.
Source§

impl CDataMut for AnyBuffer

Source§

fn mut_indicator_ptr(&mut self) -> *mut isize

Indicates the length of variable sized types. May be zero for fixed sized types.
Source§

fn mut_value_ptr(&mut self) -> *mut c_void

Pointer to a value corresponding to the one described by cdata_type.
Source§

impl ColumnBuffer for AnyBuffer

Source§

fn fill_default(&mut self, from: usize, to: usize)

Fills the column with the default representation of values, between from and to index.

Source§

type View<'a> = AnySlice<'a>

Immutable view on the column data. Used in safe abstractions. User must not be able to access uninitialized or invalid memory of the buffer through this interface.
Source§

fn capacity(&self) -> usize

Current capacity of the column
Source§

fn view(&self, valid_rows: usize) -> AnySlice<'_>

Num rows may not exceed the actual amount of valid num_rows filled by 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.
Source§

fn has_truncated_values(&self, num_rows: usize) -> Option<Indicator>

Some if any value is truncated in the range [0, num_rows). Read more
Source§

impl Debug for AnyBuffer

Source§

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

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

impl HasDataType for AnyBuffer

Source§

fn data_type(&self) -> DataType

The SQL data as which the parameter is bound to ODBC.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.