Struct data_plane_api::google::api::expr::v1alpha1::decl::function_decl::Overload
source · [−]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
sourceimpl Message for Overload
impl Message for Overload
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moresourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreimpl StructuralPartialEq for Overload
Auto Trait Implementations
impl RefUnwindSafe for Overload
impl Send for Overload
impl Sync for Overload
impl Unpin for Overload
impl UnwindSafe for Overload
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request