Struct pgrx_sql_entity_graph::PostgresEnum
source · pub struct PostgresEnum { /* private fields */ }
Expand description
A parsed #[derive(PostgresEnum)]
item.
It should be used with syn::parse::Parse
functions.
Using quote::ToTokens
will output the declaration for a pgrx::datum::pgrx_sql_entity_graph::PostgresEnumEntity
.
use syn::{Macro, parse::Parse, parse_quote, parse};
use quote::{quote, ToTokens};
use pgrx_sql_entity_graph::PostgresEnum;
use pgrx_sql_entity_graph::CodeEnrichment;
let parsed: CodeEnrichment<PostgresEnum> = parse_quote! {
#[derive(PostgresEnum)]
enum Demo {
Example,
}
};
let sql_graph_entity_tokens = parsed.to_token_stream();
Implementations§
source§impl PostgresEnum
impl PostgresEnum
pub fn new( name: Ident, generics: Generics, variants: Punctuated<Variant, Comma>, 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 PostgresEnum
impl Clone for PostgresEnum
source§fn clone(&self) -> PostgresEnum
fn clone(&self) -> PostgresEnum
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