pub struct Routine {
Show 15 fields pub etag: String, pub routine_reference: RoutineReference, pub routine_type: RoutineType, pub creation_time: Option<i64>, pub last_modified_time: Option<i64>, pub language: Option<Language>, pub arguments: Option<Vec<Argument>>, pub return_type: Option<StandardSqlDataType>, pub return_table_type: Option<StandardSqlTableType>, pub imported_libraries: Option<Vec<String>>, pub definition_body: String, pub description: Option<String>, pub determinism_level: Option<DeterminismLevel>, pub remote_function_options: Option<RemoteFunctionOptions>, pub spark_options: Option<SparkOptions>,
}

Fields§

§etag: String

Output only. A hash of this resource.

§routine_reference: RoutineReference

Required. Reference describing the ID of this routine.

§routine_type: RoutineType

Required. The type of routine.

§creation_time: Option<i64>

Output only. The time when this routine was created, in milliseconds since the epoch.

§last_modified_time: Option<i64>

Output only. The time when this routine was last modified, in milliseconds since the epoch.

§language: Option<Language>

Optional. Defaults to “SQL” if remoteFunctionOptions field is absent, not set otherwise.

§arguments: Option<Vec<Argument>>

Optional.

§return_type: Option<StandardSqlDataType>

Optional if language = “SQL”; required otherwise. Cannot be set if routineType = “TABLE_VALUED_FUNCTION”. If absent, the return type is inferred from definitionBody at query time in each query that references this routine. If present, then the evaluated result will be cast to the specified returned type at query time. For example, for the functions created with the following statements: CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x + y); CREATE FUNCTION Increment(x FLOAT64) AS (Add(x, 1)); CREATE FUNCTION Decrement(x FLOAT64) RETURNS FLOAT64 AS (Add(x, -1)); The returnType is {typeKind: “FLOAT64”} for Add and Decrement, and is absent for Increment (inferred as FLOAT64 at query time). Suppose the function Add is replaced by CREATE OR REPLACE FUNCTION Add(x INT64, y INT64) AS (x + y); Then the inferred return type of Increment is automatically changed to INT64 at query time, while the return type of Decrement remains FLOAT64.

§return_table_type: Option<StandardSqlTableType>

Optional. Can be set only if routineType = “TABLE_VALUED_FUNCTION”. If absent, the return table type is inferred from definitionBody at query time in each query that references this routine. If present, then the columns in the evaluated table result will be cast to match the column types specified in return table type, at query time.

§imported_libraries: Option<Vec<String>>

Optional. If language = “JAVASCRIPT”, this field stores the path of the imported JAVASCRIPT libraries.

§definition_body: String

Required. The body of the routine. For functions, this is the expression in the AS clause. If language=SQL, it is the substring inside (but excluding) the parentheses. For example, for the function created with the following statement: CREATE FUNCTION JoinLines(x string, y string) as (concat(x, “\n”, y)) The definitionBody is concat(x, “\n”, y) (\n is not replaced with linebreak). If language=JAVASCRIPT, it is the evaluated string in the AS clause. For example, for the function created with the following statement: CREATE FUNCTION f() RETURNS STRING LANGUAGE js AS ‘return “\n”;\n’ The definitionBody is return “\n”;\n Note that both \n are replaced with linebreaks.

§description: Option<String>

Optional. The description of the routine, if defined.

§determinism_level: Option<DeterminismLevel>

Optional. The determinism level of the JavaScript UDF, if defined.

§remote_function_options: Option<RemoteFunctionOptions>

Optional. Remote function specific options.

§spark_options: Option<SparkOptions>

Optional. Spark specific options.

Trait Implementations§

source§

impl Clone for Routine

source§

fn clone(&self) -> Routine

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Routine

source§

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

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

impl Default for Routine

source§

fn default() -> Routine

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Routine

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq<Routine> for Routine

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Routine

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Routine

source§

impl StructuralEq for Routine

source§

impl StructuralPartialEq for Routine

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> Allocation for Twhere T: RefUnwindSafe + Send + Sync,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,