pub struct Overload {
    pub overload_id: String,
    pub params: Vec<Type>,
    pub type_params: Vec<String>,
    pub result_type: Option<Type>,
    pub is_instance_function: bool,
    pub doc: String,
}
Expand description

An overload indicates a function’s parameter types and return type, and may optionally include a function body described in terms of [Expr][google.api.expr.v1alpha1.Expr] values.

Functions overloads are declared in either a function or method call-style. For methods, the params\[0\] is the expected type of the target receiver.

Overloads must have non-overlapping argument types after erasure of all parameterized type variables (similar as type erasure in Java).

Fields

overload_id: String

Required. Globally unique overload name of the function which reflects the function name and argument types.

This will be used by a [Reference][google.api.expr.v1alpha1.Reference] to indicate the overload_id that was resolved for the function name.

params: Vec<Type>

List of function parameter [Type][google.api.expr.v1alpha1.Type] values.

Param types are disjoint after generic type parameters have been replaced with the type DYN. Since the DYN type is compatible with any other type, this means that if A is a type parameter, the function types int<A> and int<int> are not disjoint. Likewise, map<string, string> is not disjoint from map<K, V>.

When the result_type of a function is a generic type param, the type param name also appears as the type of on at least one params.

type_params: Vec<String>

The type param names associated with the function declaration.

For example, function ex<K,V>(K key, map<K, V> map) : V would yield the type params of K, V.

result_type: Option<Type>

Required. The result type of the function. For example, the operator string.isEmpty() would have result_type of kind: BOOL.

is_instance_function: bool

Whether the function is to be used in a method call-style x.f(...) or a function call-style f(x, ...).

For methods, the first parameter declaration, params\[0\] is the expected type of the target receiver.

doc: String

Documentation string for the overload.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Returns the encoded length of the message without a length delimiter.
Clears the message, resetting all fields to their default.
Encodes the message to a buffer. Read more
Encodes the message to a newly allocated buffer.
Encodes the message with a length-delimiter to a buffer. Read more
Encodes the message with a length-delimiter to a newly allocated buffer.
Decodes an instance of the message from a buffer. Read more
Decodes a length-delimited instance of the message from the buffer.
Decodes an instance of the message from a buffer, and merges it into self. Read more
Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

Wrap the input message T in a tonic::Request
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more