Trait oracle::oci_attr::OciAttr

source ·
pub unsafe trait OciAttr {
    type HandleType: HandleType;
    type Mode: Mode;
    type DataType: DataType + ?Sized;

    const ATTR_NUM: u32;
}
Expand description

Required Associated Types§

source

type HandleType: HandleType

SvcCtx, Session, Server or Stmt. Other handle and descriptor types are unsupported.

source

type Mode: Mode

source

type DataType: DataType + ?Sized

Attribute data type

The following table is the mapping between basic data types. If incorrect types are specified, the behavior is undefined.

Types in Oracle manualRust type
ub1*/ub1u8
ub2*/ub2u16
ub4*/ub4u32
ub8*/ub8u64
boolean*/booleanbool
pointer types such as OCISession**/OCISession**mut c_void
oratext**/oratext*str 1
ub1*(with length; value is copied; is really a ub1 array)[u8] 2

The following table is the mapping of predefined types based on basic data types. They are designed for specific attributes.

Types in Oracle manualRust type
ub8*DurationUsecU64 which gets u64 values representing microsecods as Duration
ub1*MaxStringSize which gets ub1 values as variants of MaxStringSize

Look at the source code of DurationUsecU64 and MaxStringSize as samples when you need to implement your own data types.


  1. Values are got as String because str implements ToOwned whose associate type Owned is String

  2. Values are got as Vec<u8> because [T] where T: Clone implements ToOwned whose associate type Owned is Vec<T>

Required Associated Constants§

source

const ATTR_NUM: u32

Attribute number defined in oci.h included in Oracle Instant Client SDK

Implementors§