Struct pgrx_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 pgrx_sql_entity_graph::PostgresType;
use pgrx_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 moreAuto Trait Implementations§
impl Freeze for PostgresType
impl RefUnwindSafe for PostgresType
impl !Send for PostgresType
impl !Sync for PostgresType
impl Unpin for PostgresType
impl UnwindSafe for PostgresType
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more