Function repr::adt::util::extract_typ_mod [−][src]
pub fn extract_typ_mod<T>(
name: &str,
typ_mod: &[u64],
val_ranges: &[(&str, T, T)]
) -> Result<Vec<T>, Error> where
T: TryFrom<u64> + Display + Ord + PartialOrd,
Expand description
Validates a PG typmod from user input and returns a vector of the supplied
values whose positions align with those of val_ranges
.
Arguments
T
: The desired type of thetyp_mod
.name
: The name to of the type to return in error messagestyp_mod
: The user-supplied typmodval_ranges
: Validtyp_mod
values. Tuples are of of the form(<attribute name>, <lower bound, inclusive>, <upper bound, inclusive>)
.