pub struct FunctionParam<X: Extension = NoExt> {
pub mode: Option<FunctionParamMode>,
pub name: Option<Ident>,
pub data_type: DataType<X>,
pub default: Option<Box<FunctionParamDefault<X>>>,
pub meta: Meta,
}Expand description
One routine parameter: an optional argument mode
(IN/OUT/INOUT/VARIADIC), an optional name, its type (b INT), and an
optional default value (b INT DEFAULT 0 / b INT = 0).
The three lead-in facets are independent: a bare type (f(int)) leaves both
mode and name unset, a mode may precede an unnamed type (f(OUT int)), and a
named parameter may carry a default. The name is PostgreSQL’s param_name =
type_function_name production (parsed with the type-name reservation
set): a type_func_name keyword
like left is a legal parameter name, a col_name keyword like int is not — so
a lone int is unambiguously the type, mirroring how PostgreSQL resolves the
name-vs-type ambiguity. The default is the PostgreSQL func_arg_with_default
tail — boxed because it is usually absent and a FunctionParamDefault (an
Expr) is comparatively large, so a default-less parameter pays only a null
pointer (the ForeignKeyRef referential-action precedent). It is parameter
metadata: an ordinary function-call argument is a
FunctionArg on the unrelated call path and is
unaffected.
Fields§
§mode: Option<FunctionParamMode>Mode selected by this syntax.
name: Option<Ident>Name referenced by this syntax.
data_type: DataType<X>Data type named by this syntax.
default: Option<Box<FunctionParamDefault<X>>>Optional default for this syntax.
meta: MetaSource location and node identity.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for FunctionParam<X>
impl<X: Clone + Extension> Clone for FunctionParam<X>
Source§fn clone(&self) -> FunctionParam<X>
fn clone(&self) -> FunctionParam<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for FunctionParam<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for FunctionParam<X>where
X: Deserialize<'de> + Extension,
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<X: Eq + Extension> Eq for FunctionParam<X>
Source§impl<X: Extension + Render> Render for FunctionParam<X>
impl<X: Extension + Render> Render for FunctionParam<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for FunctionParam<X>
impl<X> Serialize for FunctionParam<X>
Source§impl<X: Extension> Spanned for FunctionParam<X>
impl<X: Extension> Spanned for FunctionParam<X>
impl<X: PartialEq + Extension> StructuralPartialEq for FunctionParam<X>
Auto Trait Implementations§
impl<X> Freeze for FunctionParam<X>where
X: Freeze,
impl<X> RefUnwindSafe for FunctionParam<X>where
X: RefUnwindSafe,
impl<X> Send for FunctionParam<X>where
X: Send,
impl<X> Sync for FunctionParam<X>where
X: Sync,
impl<X> Unpin for FunctionParam<X>where
X: Unpin,
impl<X> UnsafeUnpin for FunctionParam<X>where
X: UnsafeUnpin,
impl<X> UnwindSafe for FunctionParam<X>where
X: UnwindSafe,
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> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.