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:
ValueTypeforVec<T>andVec<Option<T>>Fromimplementations forVec<T>,Vec<Option<T>>,Box<[T]>,Box<[Option<T>]>,[T; N], and[Option<T>; N]intoValueandArray
Required Associated Typesยง
Sourcetype ArrayValueType: ArrayValue
type ArrayValueType: ArrayValue
The underlying element type stored in the array.
Usually this is a built-in type like String, i32, Uuid, โฆ
Required Methodsยง
Sourcefn into_array_value(self) -> Self::ArrayValueType
fn into_array_value(self) -> Self::ArrayValueType
Convert self into the underlying array element type.
Sourcefn try_from_value(v: Value) -> Result<Vec<Option<Self>>, ValueTypeErr>
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.