Struct pgx_sql_entity_graph::PostgresType 
source · pub struct PostgresType { /* private fields */ }Expand description
A parsed #[derive(PostgresType)] item.
It should be used with syn::parse::Parse functions.
Using quote::ToTokens will output the declaration for a PostgresTypeEntity.
use syn::{Macro, parse::Parse, parse_quote, parse};
use quote::{quote, ToTokens};
use pgx_sql_entity_graph::PostgresType;
use pgx_sql_entity_graph::CodeEnrichment;
let parsed: CodeEnrichment<PostgresType> = parse_quote! {
    #[derive(PostgresType)]
    struct Example<'a> {
        demo: &'a str,
    }
};
let sql_graph_entity_tokens = parsed.to_token_stream();Implementations§
source§impl PostgresType
 
impl PostgresType
pub fn new(
    name: Ident,
    generics: Generics,
    in_fn: Ident,
    out_fn: Ident,
    to_sql_config: ToSqlConfig
) -> Result<CodeEnrichment<Self>, Error>
pub fn from_derive_input(
    derive_input: DeriveInput
) -> Result<CodeEnrichment<Self>, Error>
Trait Implementations§
source§impl Clone for PostgresType
 
impl Clone for PostgresType
source§fn clone(&self) -> PostgresType
 
fn clone(&self) -> PostgresType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read more