pub struct Routine {Show 14 fields
pub schema: String,
pub name: String,
pub description: Option<String>,
pub params: Vec<RoutineParam>,
pub return_type: RetType,
pub returns_composite: bool,
pub volatility: FuncVolatility,
pub has_variadic: bool,
pub isolation_level: Option<String>,
pub settings: Vec<(String, String)>,
pub is_procedure: bool,
pub media_type: Option<String>,
pub media_base_type: Option<String>,
pub output_columns: Vec<(String, String)>,
}Expand description
A stored function or procedure.
Fields§
§schema: StringSchema name
name: StringFunction name
description: Option<String>Description from comment
params: Vec<RoutineParam>Function parameters
return_type: RetTypeReturn type
returns_composite: boolWhether the return type is composite (a row type or record), meaning
SELECT * FROM fn() expands to the type’s own columns rather than a
single column named after the function.
volatility: FuncVolatilityFunction volatility
has_variadic: boolWhether the function has VARIADIC parameters
isolation_level: Option<String>Isolation level (if set by function)
settings: Vec<(String, String)>Function-level GUC settings
is_procedure: boolWhether this is a procedure (vs function)
media_type: Option<String>The media type this function’s value already is.
A domain named image/png is a declaration about the value, not a type
the API layer serialises: returns "text/plain" returns text, and
wrapping it in JSON would be answering a question nobody asked. */*
is spelled that way in the catalogue and reaches a client as
application/octet-stream, which is what “some bytes” is called on the
wire.
media_base_type: Option<String>The type that media-type domain is a domain over.
A bytea renders as \x followed by hex when this side cannot name
its type, and that rendering is a description of the bytes rather than
the bytes. See Self::media_type.
output_columns: Vec<(String, String)>The columns a RETURNS TABLE function’s rows have, as (name, type).
A function returning rows of a table is shaped by that table, whose
columns are known. One declaring its own columns is not, and this is
the only account of them – without it the result can only be selected
with *, and a column of a type this process cannot decode comes back
null with nothing to say it should have been rendered by the database.
Implementations§
Source§impl Routine
impl Routine
Sourcepub fn produced_media_type(&self) -> Option<&str>
pub fn produced_media_type(&self) -> Option<&str>
The media type this function produces, as a client would name it.
Source§impl Routine
impl Routine
Sourcepub fn qualified_identifier(&self) -> QualifiedIdentifier
pub fn qualified_identifier(&self) -> QualifiedIdentifier
Get the qualified identifier for this routine.
Sourcepub fn is_safe_for_get(&self) -> bool
pub fn is_safe_for_get(&self) -> bool
Check if this function is safe for GET requests.
Sourcepub fn required_params(&self) -> impl Iterator<Item = &RoutineParam>
pub fn required_params(&self) -> impl Iterator<Item = &RoutineParam>
Get required parameters (no default).
Sourcepub fn find_param(&self, name: &str) -> Option<&RoutineParam>
pub fn find_param(&self, name: &str) -> Option<&RoutineParam>
Find a parameter by name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Routine
impl<'de> Deserialize<'de> for Routine
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>,
Auto Trait Implementations§
impl Freeze for Routine
impl RefUnwindSafe for Routine
impl Send for Routine
impl Sync for Routine
impl Unpin for Routine
impl UnsafeUnpin for Routine
impl UnwindSafe for Routine
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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