pub fn heap_getattr<T: FromDatum, AllocatedBy: WhoAllocated>(
tuple: &PgBox<HeapTupleData, AllocatedBy>,
attno: NonZeroUsize,
tupdesc: &PgTupleDesc<'_>,
) -> Option<T>
Expand description
Extract an attribute of a heap tuple and return it as Rust type.
This works for either system or user attributes. The given attnum
is properly range-checked.
If the field in question has a NULL value, we return None
.
Otherwise, a Some(T)
‘tup’ is the pointer to the heap tuple. ‘attnum’ is the attribute number of the column (field) caller wants. ‘tupleDesc’ is a pointer to the structure describing the row and all its fields.
attno
is 1-based