Skip to main content

SqlContainerType

Trait SqlContainerType 

Source
pub trait SqlContainerType {
    // Required methods
    fn unwrap_element_type(container: &SqlScalarType) -> &SqlScalarType;
    fn wrap_element_type(element: SqlScalarType) -> SqlScalarType;
}
Expand description

Trait for SQL container types whose element/value type can be extracted from or wrapped into a SqlScalarType.

Implemented by DatumList, Array, DatumMap, and Range. The #[sqlfunc] proc macro emits calls to these associated functions so that Rust’s type system resolves the correct unwrap/wrap behavior at compile time, instead of relying on string-matching type names in the AST.

The methods are deliberately associated functions (no &self) because they operate on SqlScalarType metadata, not on container values.

Required Methods§

Source

fn unwrap_element_type(container: &SqlScalarType) -> &SqlScalarType

Extract the element type from a container scalar type.

Source

fn wrap_element_type(element: SqlScalarType) -> SqlScalarType

Construct a container scalar type from an element type.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§