ArrayElement

Trait ArrayElement 

Source
pub trait ArrayElement: Sized {
    type ArrayValueType: ArrayValue;

    // Required methods
    fn into_array_value(self) -> Self::ArrayValueType;
    fn try_from_value(v: Value) -> Result<Vec<Option<Self>>, ValueTypeErr>;
}
Available on crate feature postgres-array only.
Expand description

Trait for custom types that can be used as PostgreSQL array elements.

When implemented, SeaQuery will provide:

  • ValueType for Vec<T> and Vec<Option<T>>
  • From implementations for Vec<T>, Vec<Option<T>>, Box<[T]>, Box<[Option<T>]>, [T; N], and [Option<T>; N] into Value and Array

Required Associated Typesยง

Source

type ArrayValueType: ArrayValue

The underlying element type stored in the array.

Usually this is a built-in type like String, i32, Uuid, โ€ฆ

Required Methodsยง

Source

fn into_array_value(self) -> Self::ArrayValueType

Convert self into the underlying array element type.

Source

fn try_from_value(v: Value) -> Result<Vec<Option<Self>>, ValueTypeErr>

Convert from a Value to Vec<Option<Self>>

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Typesยง

Sourceยง

impl ArrayElement for bool

Sourceยง

impl ArrayElement for char

Sourceยง

impl ArrayElement for f32

Sourceยง

impl ArrayElement for f64

Sourceยง

impl ArrayElement for i8

Sourceยง

impl ArrayElement for i16

Sourceยง

impl ArrayElement for i32

Sourceยง

impl ArrayElement for i64

Sourceยง

impl ArrayElement for u16

Sourceยง

impl ArrayElement for u32

Sourceยง

impl ArrayElement for u64

Sourceยง

impl ArrayElement for String

Sourceยง

impl ArrayElement for Vec<u8>

Sourceยง

impl ArrayElement for Date

Sourceยง

impl ArrayElement for DateTime

Sourceยง

impl ArrayElement for Time

Sourceยง

impl ArrayElement for Date

Sourceยง

impl ArrayElement for Time

Sourceยง

impl ArrayElement for Braced

Sourceยง

impl ArrayElement for Hyphenated

Sourceยง

impl ArrayElement for Simple

Sourceยง

impl ArrayElement for Urn

Implementorsยง

Sourceยง

impl ArrayElement for IpNetwork

Sourceยง

impl ArrayElement for Value

Sourceยง

impl ArrayElement for BigDecimal

Sourceยง

impl ArrayElement for sea_query::value::prelude::DateTime<FixedOffset>

Sourceยง

impl ArrayElement for sea_query::value::prelude::DateTime<Local>

Sourceยง

impl ArrayElement for sea_query::value::prelude::DateTime<Utc>

Sourceยง

impl ArrayElement for Decimal

Sourceยง

impl ArrayElement for MacAddress

Sourceยง

impl ArrayElement for NaiveDate

Sourceยง

impl ArrayElement for NaiveDateTime

Sourceยง

impl ArrayElement for NaiveTime

Sourceยง

impl ArrayElement for OffsetDateTime

Sourceยง

impl ArrayElement for PrimitiveDateTime

Sourceยง

impl ArrayElement for Timestamp

Sourceยง

impl ArrayElement for Uuid

Sourceยง

impl ArrayElement for Zoned