pub struct CreateFunction {
pub name: String,
pub or_replace: bool,
pub is_procedure: bool,
pub params: Vec<FunctionParam>,
pub returns: FunctionReturns,
pub return_type_reference: Option<RoutineColumnTypeReference>,
pub language: String,
pub body: FunctionBody,
pub volatility: FunctionVolatility,
pub strict: bool,
}Expand description
CREATE [OR REPLACE] FUNCTION | PROCEDURE.
Fields§
§name: String§or_replace: bool§is_procedure: bool§params: Vec<FunctionParam>§returns: FunctionReturns§return_type_reference: Option<RoutineColumnTypeReference>Parsed %TYPE identity for a scalar or set return declaration until registration resolves it.
language: StringLower-cased language name (plpgsql, sql).
body: FunctionBody§volatility: FunctionVolatility§strict: boolSTRICT / RETURNS NULL ON NULL INPUT - the function is not
invoked when any input argument is NULL; the result is NULL.
Implementations§
Source§impl CreateFunction
impl CreateFunction
Sourcepub fn signature_arity(&self) -> usize
pub fn signature_arity(&self) -> usize
Number of call-signature parameters: IN + INOUT for
functions; every non-TABLE parameter for procedures (callers
pass placeholder arguments for procedure OUT parameters,
matching PostgreSQL 14+).
Sourcepub fn required_arity(&self) -> usize
pub fn required_arity(&self) -> usize
Number of signature parameters without a DEFAULT.
Sourcepub fn signature_params(&self) -> Vec<&FunctionParam>
pub fn signature_params(&self) -> Vec<&FunctionParam>
Signature parameters in declaration order.
Sourcepub fn output_params(&self) -> Vec<&FunctionParam>
pub fn output_params(&self) -> Vec<&FunctionParam>
Parameters that shape the result row: OUT + INOUT +
RETURNS TABLE columns, in declaration order.
Sourcepub fn returns_set(&self) -> bool
pub fn returns_set(&self) -> bool
True when the routine produces a row set (RETURNS SETOF /
RETURNS TABLE).
Trait Implementations§
Source§impl Clone for CreateFunction
impl Clone for CreateFunction
Source§fn clone(&self) -> CreateFunction
fn clone(&self) -> CreateFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateFunction
impl Debug for CreateFunction
Source§impl<'de> Deserialize<'de> for CreateFunction
impl<'de> Deserialize<'de> for CreateFunction
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CreateFunction
impl RefUnwindSafe for CreateFunction
impl Send for CreateFunction
impl Sync for CreateFunction
impl Unpin for CreateFunction
impl UnsafeUnpin for CreateFunction
impl UnwindSafe for CreateFunction
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
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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