Skip to main content

Projection

Trait Projection 

pub trait Projection {
    type Output;

    // Required methods
    fn selection_query(&self) -> SelectionQuery;
    fn decode_one(&self, value: Value) -> Result<Self::Output, CratestackError>;

    // Provided methods
    fn decode_many(
        &self,
        value: Value,
    ) -> Result<Vec<Self::Output>, CratestackError> { ... }
    fn decode_page(
        &self,
        value: Value,
    ) -> Result<Page<Self::Output>, CratestackError> { ... }
}
Expand description

Back-compat alias — the trait moved to cratestack-core and was renamed ProjectionDecoder to free up the Projection name for the SQL value type in cratestack-sql.

Required Associated Types§

type Output

Required Methods§

fn selection_query(&self) -> SelectionQuery

fn decode_one(&self, value: Value) -> Result<Self::Output, CratestackError>

Provided Methods§

fn decode_many( &self, value: Value, ) -> Result<Vec<Self::Output>, CratestackError>

fn decode_page( &self, value: Value, ) -> Result<Page<Self::Output>, CratestackError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl ProjectionDecoder for SelectionQuery