Skip to main content

Function

Struct Function 

Source
pub struct Function {
Show 26 fields pub oid: u32, pub name: String, pub namespace: u32, pub owner: u32, pub lang: u32, pub cost: f32, pub rows: u32, pub support: u32, pub kind: u8, pub strict: bool, pub leakproof: bool, pub volatile: u8, pub parallel: u8, pub rettype: u32, pub retset: bool, pub argtypes: Vec<u32>, pub allargtypes: Vec<u32>, pub argmodes: Vec<u8>, pub argnames: Vec<String>, pub argdefaults: Option<String>, pub nargdefaults: i16, pub src: String, pub bin: String, pub body: Option<FunctionBody>, pub config: Vec<String>, pub secdef: bool,
}
Expand description

A function, one row of pg_proc: a function of the setup of a new cluster, such as a function in SQL of information_schema, or a function that CREATE FUNCTION makes.

Fields§

§oid: u32

The OID. Catalog::create_function sets it.

§name: String

The name.

§namespace: u32

The OID of the schema.

§owner: u32

The OID of the owner role.

§lang: u32

prolang: the OID of the language.

§cost: f32

procost: the cost in units of cpu_operator_cost, a positive number.

§rows: u32

prorows: the number of rows of a function that returns a set, or 0.

§support: u32

prosupport: the OID of the support function, or 0.

§kind: u8

prokind: f for a function, p for a procedure or a for an aggregate.

§strict: bool

proisstrict: true when a null argument gives null without a call.

§leakproof: bool

proleakproof: true when the function has no side effects and gives no information about its arguments other than its result.

§volatile: u8

provolatile: i immutable, s stable or v volatile.

§parallel: u8

proparallel: s safe, r restricted or u unsafe.

§rettype: u32

prorettype: the OID of the result type.

§retset: bool

proretset: true when the function returns a set.

§argtypes: Vec<u32>

proargtypes: the types of the input arguments.

§allargtypes: Vec<u32>

proallargtypes: the types of all the arguments, with the OUT arguments. The list is empty when all the arguments are input arguments.

§argmodes: Vec<u8>

proargmodes: the mode of each argument, i, o, b or t. The list is empty when all the arguments are input arguments.

§argnames: Vec<String>

proargnames: the name of each argument, with an empty name for an argument without a name. The list is empty when no argument has a name.

§argdefaults: Option<String>

proargdefaults: the defaults of the last input arguments, in the stored form of a list of expressions, or None when no argument has a default.

§nargdefaults: i16

pronargdefaults: the number of the defaults in argdefaults.

§src: String

prosrc: the body in a string, or empty for a body in SQL.

§bin: String

probin: the file of a function in C, or empty for another function.

§body: Option<FunctionBody>

The text of the statement that made the function, or None.

§config: Vec<String>

proconfig: the settings that apply during a call, each one as name=value, with the name of the parameter as PostgreSQL spells it.

§secdef: bool

prosecdef: true for SECURITY DEFINER, which runs the function as its owner.

Trait Implementations§

Source§

impl Clone for Function

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Function

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Function

Source§

impl PartialEq for Function

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Function

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.