Struct google_api_proto::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§
source§impl Message for Overload
impl Message for Overload
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Overload
impl PartialEq for Overload
impl StructuralPartialEq for Overload
Auto Trait Implementations§
impl Freeze for Overload
impl RefUnwindSafe for Overload
impl Send for Overload
impl Sync for Overload
impl Unpin for Overload
impl UnwindSafe for Overload
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request