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 the typ_mod.
  • name: The name to of the type to return in error messages
  • typ_mod: The user-supplied typmod
  • val_ranges: Valid typ_mod values. Tuples are of of the form (<attribute name>, <lower bound, inclusive>, <upper bound, inclusive>).