odbc_safe/indicator.rs
1use sys::*;
2
3/// Used to indicate the required target buffer length.
4#[derive(Debug, Clone, Copy)]
5pub enum Indicator {
6 /// The length required to hold all the data.
7 Length(SQLLEN),
8 /// Driver does not know how much data is available.
9 NoTotal,
10 /// The value to be retrieved is NULL.
11 Null,
12}
13
14impl From<SQLLEN> for Indicator {
15 fn from(source: SQLLEN) -> Indicator {
16 match source {
17 SQL_NO_TOTAL => Indicator::NoTotal,
18 SQL_NULL_DATA => Indicator::Null,
19 other => Indicator::Length(other),
20 }
21 }
22}