pub struct Function {Show 17 fields
pub qname: QualifiedName,
pub args: Vec<FunctionArg>,
pub arg_types_normalized: NormalizedArgTypes,
pub return_type: ReturnType,
pub language: FunctionLanguage,
pub body: NormalizedBody,
pub body_dependencies: Vec<DepEdge>,
pub volatility: Volatility,
pub strict: bool,
pub security: SecurityMode,
pub parallel: ParallelSafety,
pub leakproof: bool,
pub cost: Option<f32>,
pub rows: Option<f32>,
pub comment: Option<String>,
pub owner: Option<Identifier>,
pub grants: Vec<Grant>,
}Expand description
A user-defined function (SQL or PL/pgSQL).
Fields§
§qname: QualifiedNameSchema-qualified function name.
args: Vec<FunctionArg>Declared argument list (all modes).
arg_types_normalized: NormalizedArgTypesNormalized identity hash over IN/INOUT/VARIADIC args only.
return_type: ReturnTypeReturn type.
language: FunctionLanguageImplementation language.
body: NormalizedBodyCanonicalized function body.
body_dependencies: Vec<DepEdge>Dependency edges extracted from the function body AST.
Filled by the T4 PL/pgSQL body parser and the T6 AST resolution pass. Empty until those passes run.
volatility: VolatilityVolatility category.
strict: boolWhether the function returns NULL immediately for any NULL input.
security: SecurityModeSecurity context (INVOKER or DEFINER).
parallel: ParallelSafetyParallel safety classification.
leakproof: boolWhether the function is marked LEAKPROOF.
cost: Option<f32>Estimated per-call cost (units: sequential page fetches).
rows: Option<f32>Estimated rows returned per call (for set-returning functions).
comment: Option<String>Optional COMMENT ON FUNCTION text.
owner: Option<Identifier>Object owner. None = unmanaged (the differ ignores ownership).
Some(role) = managed: diff emits ALTER FUNCTION ... OWNER TO role.
grants: Vec<Grant>Grants on this object. Empty = no grants. Canonicalized.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Function
Source§impl Equiv for Function
impl Equiv for Function
Source§fn differences(&self, other: &Self) -> Vec<Difference>
fn differences(&self, other: &Self) -> Vec<Difference>
self and other. Empty list = equivalent.Source§fn canonical_eq(&self, other: &Self) -> bool
fn canonical_eq(&self, other: &Self) -> bool
true iff self.differences(other).is_empty().Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more