pub trait TryGetable: Sized {
// Required method
fn try_get_by<I: ColIdx>(
res: &QueryResult,
index: I,
) -> Result<Self, TryGetError>;
// Provided methods
fn try_get(
res: &QueryResult,
pre: &str,
col: &str,
) -> Result<Self, TryGetError> { ... }
fn try_get_by_index(
res: &QueryResult,
index: usize,
) -> Result<Self, TryGetError> { ... }
}Expand description
Decode a single column value out of a QueryResult.
Implemented for every primitive SeaORM understands (integers, strings,
booleans, JSON, UUIDs, chrono / time types when their features are
enabled, etc.). User code rarely names this trait directly; itโs the
foundation that FromQueryResult builds on.
Required Methodsยง
Sourcefn try_get_by<I: ColIdx>(
res: &QueryResult,
index: I,
) -> Result<Self, TryGetError>
fn try_get_by<I: ColIdx>( res: &QueryResult, index: I, ) -> Result<Self, TryGetError>
Decode the value at the column named or positioned by index.
Provided Methodsยง
Sourcefn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
fn try_get(res: &QueryResult, pre: &str, col: &str) -> Result<Self, TryGetError>
Decode the value at column {pre}{col} โ pre is the prefix used
when nesting partial models or joining tables.
Sourcefn try_get_by_index(
res: &QueryResult,
index: usize,
) -> Result<Self, TryGetError>
fn try_get_by_index( res: &QueryResult, index: usize, ) -> Result<Self, TryGetError>
Decode the value at the given positional index in the SELECT list.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Typesยง
Sourceยงimpl TryGetable for Braced
impl TryGetable for Braced
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for DateTime<FixedOffset>
impl TryGetable for DateTime<FixedOffset>
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for DateTime<Local>
impl TryGetable for DateTime<Local>
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for DateTime<Utc>
impl TryGetable for DateTime<Utc>
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Enum
impl TryGetable for Enum
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Hyphenated
impl TryGetable for Hyphenated
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Simple
impl TryGetable for Simple
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for String
impl TryGetable for String
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Urn
impl TryGetable for Urn
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Braced>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Braced>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Date>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Date>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<DateTime<FixedOffset>>
Available on crate feature postgres-array only.
impl TryGetable for Vec<DateTime<FixedOffset>>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<DateTime<Local>>
Available on crate feature postgres-array only.
impl TryGetable for Vec<DateTime<Local>>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<DateTime<Utc>>
Available on crate feature postgres-array only.
impl TryGetable for Vec<DateTime<Utc>>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Decimal>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Decimal>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Hyphenated>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Hyphenated>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<IpNetwork>
Available on crate feature postgres-array only.
impl TryGetable for Vec<IpNetwork>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<NaiveDate>
Available on crate feature postgres-array only.
impl TryGetable for Vec<NaiveDate>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<NaiveDateTime>
Available on crate feature postgres-array only.
impl TryGetable for Vec<NaiveDateTime>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<NaiveTime>
Available on crate feature postgres-array only.
impl TryGetable for Vec<NaiveTime>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<OffsetDateTime>
Available on crate feature postgres-array only.
impl TryGetable for Vec<OffsetDateTime>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<PrimitiveDateTime>
Available on crate feature postgres-array only.
impl TryGetable for Vec<PrimitiveDateTime>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Simple>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Simple>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<String>
Available on crate feature postgres-array only.
impl TryGetable for Vec<String>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Time>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Time>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Urn>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Urn>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Uuid>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Uuid>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Value>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Value>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<Vec<u8>>
Available on crate feature postgres-array only.
impl TryGetable for Vec<Vec<u8>>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<bool>
Available on crate feature postgres-array only.
impl TryGetable for Vec<bool>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<f32>
Available on crate feature postgres-array only.
impl TryGetable for Vec<f32>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<f64>
Available on crate feature postgres-array only.
impl TryGetable for Vec<f64>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<i8>
Available on crate feature postgres-array only.
impl TryGetable for Vec<i8>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<i16>
Available on crate feature postgres-array only.
impl TryGetable for Vec<i16>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<i32>
Available on crate feature postgres-array only.
impl TryGetable for Vec<i32>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<i64>
Available on crate feature postgres-array only.
impl TryGetable for Vec<i64>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<u8>
impl TryGetable for Vec<u8>
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for Vec<u32>
Available on crate feature postgres-array only.
impl TryGetable for Vec<u32>
Available on crate feature
postgres-array only.fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for bool
impl TryGetable for bool
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for f32
impl TryGetable for f32
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for f64
impl TryGetable for f64
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for i8
impl TryGetable for i8
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for i16
impl TryGetable for i16
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for i32
impl TryGetable for i32
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for i64
impl TryGetable for i64
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for u8
impl TryGetable for u8
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for u16
impl TryGetable for u16
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for u32
impl TryGetable for u32
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl TryGetable for u64
impl TryGetable for u64
fn try_get_by<I: ColIdx>(res: &QueryResult, idx: I) -> Result<Self, TryGetError>
Sourceยงimpl<T: TryGetable> TryGetable for Option<T>
impl<T: TryGetable> TryGetable for Option<T>
fn try_get_by<I: ColIdx>( res: &QueryResult, index: I, ) -> Result<Self, TryGetError>
Sourceยงimpl<T> TryGetable for Vec<T>where
T: TryGetableArray,
impl<T> TryGetable for Vec<T>where
T: TryGetableArray,
fn try_get_by<I: ColIdx>( res: &QueryResult, index: I, ) -> Result<Self, TryGetError>
Implementorsยง
impl TryGetable for ChronoUnixTimestamp
Available on crate feature
with-chrono only.impl TryGetable for ChronoUnixTimestampMillis
Available on crate feature
with-chrono only.impl TryGetable for Date
impl TryGetable for Decimal
Available on crate feature
with-rust_decimal only.impl TryGetable for IpNetwork
impl TryGetable for NaiveDate
impl TryGetable for NaiveDateTime
impl TryGetable for NaiveTime
impl TryGetable for OffsetDateTime
impl TryGetable for PermissionId
Available on crate feature
rbac only.impl TryGetable for PrimitiveDateTime
impl TryGetable for ResourceId
Available on crate feature
rbac only.impl TryGetable for RoleId
Available on crate feature
rbac only.impl TryGetable for TextUuid
Available on crate feature
with-uuid only.impl TryGetable for Time
impl TryGetable for TimeUnixTimestamp
Available on crate feature
with-time only.impl TryGetable for TimeUnixTimestampMillis
Available on crate feature
with-time only.impl TryGetable for UserId
Available on crate feature
rbac only.impl TryGetable for Uuid
impl TryGetable for Value
impl TryGetable for Vector
Available on crate feature
postgres-vector only.impl<T> TryGetable for Twhere
T: TryGetableFromJson,
Available on crate feature
with-json only.