odbc_api::buffers

Trait FetchRow

Source
pub unsafe trait FetchRow: Copy {
    // Required methods
    unsafe fn bind_columns_to_cursor(
        &mut self,
        cursor: StatementRef<'_>,
    ) -> Result<(), Error>;
    fn find_truncation(&self) -> Option<TruncationInfo>;
}
Expand description

FetchRows can be bound to a crate::Cursor to enable row wise (bulk) fetching of data as opposed to column wise fetching. Since all rows are bound to a C-API in a contigious block of memory the row itself should be representable as such. Concretly that means that types like String can not be supported directly by FetchRows for efficient bulk fetching, due to the fact it points to data on the heap.

This trait is implement by tuples of FetchRowMember. In addition it can also be derived for structs there all members implement FetchRowMember using the Fetch derive macro if the optional derive feature is activated.

§Safety

  • All the bound buffers need to be valid for the lifetime of the row.
  • The offsets into the memory for the field representing a column, must be constant for all types of the row. This is required to make the row suitable for fetching in bulk, as only the first row is bound explicitly, and the bindings for all consequitive rows is calculated by taking the size of the row in bytes multiplied by buffer index.

Required Methods§

Source

unsafe fn bind_columns_to_cursor( &mut self, cursor: StatementRef<'_>, ) -> Result<(), Error>

Binds the columns of the result set to members of the row.

§Safety

Caller must ensure self is alive and not moved in memory for the duration of the binding.

Source

fn find_truncation(&self) -> Option<TruncationInfo>

If it exists, this returns the “buffer index” of a member, which has been truncated.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FetchRow for ()

Source§

impl<A: FetchRowMember> FetchRow for (A,)

Source§

impl<A: FetchRowMember, B: FetchRowMember> FetchRow for (A, B)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember> FetchRow for (A, B, C)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember> FetchRow for (A, B, C, D)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember> FetchRow for (A, B, C, D, E)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember> FetchRow for (A, B, C, D, E, F)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember> FetchRow for (A, B, C, D, E, F, G)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember, V: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember, V: FetchRowMember, W: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember, V: FetchRowMember, W: FetchRowMember, X: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember, V: FetchRowMember, W: FetchRowMember, X: FetchRowMember, Y: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)

Source§

impl<A: FetchRowMember, B: FetchRowMember, C: FetchRowMember, D: FetchRowMember, E: FetchRowMember, F: FetchRowMember, G: FetchRowMember, H: FetchRowMember, I: FetchRowMember, J: FetchRowMember, K: FetchRowMember, L: FetchRowMember, M: FetchRowMember, N: FetchRowMember, O: FetchRowMember, P: FetchRowMember, Q: FetchRowMember, R: FetchRowMember, S: FetchRowMember, T: FetchRowMember, U: FetchRowMember, V: FetchRowMember, W: FetchRowMember, X: FetchRowMember, Y: FetchRowMember, Z: FetchRowMember> FetchRow for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)

Implementors§