Skip to main content

ArrayOf

Trait ArrayOf 

Source
pub trait ArrayOf<Element: SqlType>: SqlType { }
Expand description

The element type of a Postgres array, which is what x = ANY(arr) compares against. Needs no seal for the reason Comparable needs none: every position is a SqlType, and that is sealed, so an outside crate has no type to put in one.

Exact on the element’s width where Comparable widens, though the database would take either. With Integer and BigInt both matching a BIGINT[], an unannotated vec![1, 2] has no one array type left to infer, and that is the shape a call site actually writes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§