pub enum BufferDesc {
Show 14 variants Binary { length: usize, }, Text { max_str_len: usize, }, WText { max_str_len: usize, }, F64 { nullable: bool, }, F32 { nullable: bool, }, Date { nullable: bool, }, Time { nullable: bool, }, Timestamp { nullable: bool, }, I8 { nullable: bool, }, I16 { nullable: bool, }, I32 { nullable: bool, }, I64 { nullable: bool, }, U8 { nullable: bool, }, Bit { nullable: bool, },
}
Expand description

Describes a column of a crate::buffers::ColumnarBuffer.

While related to to the crate::DataType of the column this is bound to, the Buffer type is different as it does not describe the type of the data source but the format the data is going to be represented in memory. While the data source is often considered to choose the buffer type the kind of processing which is supposed to be applied to the data may be even more important if choosing the a buffer for the cursor type. E.g. if you intend to print a date to standard out it may be more reasonable to bind it as Text rather than Date.

Variants§

§

Binary

Fields

§length: usize

Maximum number of bytes per value.

Variable sized binary buffer, holding up to length bytes per value.

§

Text

Fields

§max_str_len: usize

Maximum string length. Terminating zero is excluded, i.e. memory for it will be implicitly allocated if required.

Text buffer holding strings with binary length of up to max_str_len.

Consider an upper bound choosing this based on the information in a DataType::Varchar column. E.g. PostgreSQL may return a field size of several GiB for individual values if a column is specified as TEXT, or Microsoft SQL Server may return 0 for a column of type VARCHAR(max). In such situations, if values are truly that large, bulk fetching data is not recommended, but streaming individual fields one by one. Usually though, the actual cells of the table in the database contain much shorter values. The best thing todo is to adapt the database schema to better reflect the actual size of the values. Lacking control over the database schema, you can always choose a smaller buffer size than initializing the buffer in disagreement with the database schema.

§

WText

Fields

§max_str_len: usize

Maximum string length. Terminating zero is excluded, i.e. memory for it will be implicitly allocated if required.

UTF-16 encoded text buffer holding strings with length of up to max_str_len. Length is in terms of 2-Byte characters.

§

F64

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

64 bit floating point

§

F32

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

32 bit floating point

§

Date

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Describes a buffer holding crate::sys::Date values.

§

Time

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Describes a buffer holding crate::sys::Time values.

§

Timestamp

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Describes a buffer holding crate::sys::Timestamp values.

§

I8

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Signed 8 Bit integer

§

I16

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Signed 16 Bit integer

§

I32

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Signed 32 Bit integer

§

I64

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Signed 64 Bit integer

§

U8

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Unsigned 8 Bit integer

§

Bit

Fields

§nullable: bool

This indicates whether or not the buffer will be able to represent NULL values. This will cause an indicator buffer to be bound.

Can either be zero or one

Implementations§

Element size of buffer if bound as a columnar row. Can be used to estimate memory for columnar bindings.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.