pub trait FunctionMetadata<A> {
// Required method
fn entity() -> FunctionMetadataEntity;
// Provided method
fn path() -> &'static str { ... }
}
Expand description
Provide SQL generation related information on functions
use pgrx_sql_entity_graph::metadata::{FunctionMetadata, Returns, SqlMapping};
fn floof(i: i32) -> String { todo!() }
type FunctionPointer = fn(i32) -> String;
let metadata = FunctionPointer::entity();
assert_eq!(
metadata.retval.return_sql,
Ok(Returns::One(SqlMapping::As("TEXT".to_string()))),
);
Required Methods§
fn entity() -> FunctionMetadataEntity
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.