Struct cpp_to_rust_generator::cpp_method::CppMethod
[−]
[src]
pub struct CppMethod { pub name: String, pub class_membership: Option<CppMethodClassMembership>, pub operator: Option<CppOperator>, pub return_type: CppType, pub arguments: Vec<CppFunctionArgument>, pub arguments_before_omitting: Option<Vec<CppFunctionArgument>>, pub allows_variadic_arguments: bool, pub include_file: String, pub origin_location: Option<CppOriginLocation>, pub template_arguments: Option<TemplateArgumentsDeclaration>, pub template_arguments_values: Option<Vec<CppType>>, pub declaration_code: Option<String>, pub inheritance_chain: Vec<CppBaseSpecifier>, pub is_fake_inherited_method: bool, pub doc: Option<CppMethodDoc>, pub is_ffi_whitelisted: bool, pub is_unsafe_static_cast: bool, pub is_direct_static_cast: bool, }
Information about a C++ method
Fields
name: String
Identifier. For class methods, this field includes only the method's own name. For free functions, this field also includes namespaces (if any).
class_membership: Option<CppMethodClassMembership>
Additional information about a class member function or None for free functions
operator: Option<CppOperator>
If the method is a C++ operator, indicates its kind
return_type: CppType
Return type of the method. Return type is reported as void for constructors and destructors.
arguments: Vec<CppFunctionArgument>
List of the method's arguments
arguments_before_omitting: Option<Vec<CppFunctionArgument>>
If Some, the method is derived from another method by omitting arguments, and this field contains all arguments of the original method.
allows_variadic_arguments: bool
Whether the argument list is terminated with "..."
include_file: String
File name of the include file where the method is defined (without full path)
origin_location: Option<CppOriginLocation>
Exact location of declaration of the method. Can be None if the method is generated automatically and doesn't have corresponding C++ declaration.
template_arguments: Option<TemplateArgumentsDeclaration>
Names of the method's template arguments. None if this is not a template method. If the method belongs to a template class, the class's template arguments are not included here.
template_arguments_values: Option<Vec<CppType>>
For an instantiated template method, this field contains the types
used for instantiation. For example, T QObject::findChild<T>()
would have
no template_arguments_values
because it's not instantiated, and
QWidget* QObject::findChild<QWidget*>()
would have QWidget*
type in
template_arguments_values
.
declaration_code: Option<String>
C++ code of the method's declaration. None if the method was not explicitly declared.
inheritance_chain: Vec<CppBaseSpecifier>
List of base classes this method was inferited from. The first item is the most base class.
is_fake_inherited_method: bool
If true, this method was not declared in headers but added in the generator's preprocessing step.
doc: Option<CppMethodDoc>
C++ documentation data for this method
is_ffi_whitelisted: bool
If true, FFI generator skips some checks
is_unsafe_static_cast: bool
If true, this is an unsafe (from base to derived) static_cast
wrapper.
is_direct_static_cast: bool
If true, this is a wrapper of static_cast
between a class and its
direct base.
Methods
impl CppMethod
[src]
pub fn argument_types_equal(&self, other: &CppMethod) -> bool
[src]
Checks if two methods have exactly the same set of input argument types
pub fn c_signature(
&self,
allocation_place: ReturnValueAllocationPlace
) -> Result<CppFfiFunctionSignature>
[src]
&self,
allocation_place: ReturnValueAllocationPlace
) -> Result<CppFfiFunctionSignature>
Creates FFI method signature for this method:
- converts all types to FFI types;
- adds "this" argument explicitly if present;
- adds "output" argument for return value if
allocation_place
isStack
.
pub fn to_ffi_signature(
&self,
cpp_data: &CppData,
type_allocation_places_override: Option<CppTypeAllocationPlace>
) -> Result<CppMethodWithFfiSignature>
[src]
&self,
cpp_data: &CppData,
type_allocation_places_override: Option<CppTypeAllocationPlace>
) -> Result<CppMethodWithFfiSignature>
Generates the FFI function signature for this method.
pub fn full_name(&self) -> String
[src]
Returns fully qualified C++ name of this method, i.e. including namespaces and class name (if any). This method is not suitable for code generation.
pub fn doc_id(&self) -> String
[src]
Returns the identifier this method would be presented with in Qt documentation.
pub fn short_text(&self) -> String
[src]
Returns short text representing values in this method (only for debugging output).
pub fn inheritance_chain_text(&self) -> String
[src]
Returns debugging output for inheritance_chain
content.
pub fn class_name(&self) -> Option<&String>
[src]
Returns name of the class this method belongs to, if any.
pub fn is_constructor(&self) -> bool
[src]
Returns true if this method is a constructor.
pub fn is_destructor(&self) -> bool
[src]
Returns true if this method is a destructor.
pub fn class_info_if_constructor(&self) -> Option<&CppMethodClassMembership>
[src]
A convenience method. Returns class_membership
if
the method is a constructor, and None
otherwise.
pub fn receiver_id(&self) -> Result<String>
[src]
Returns the identifier that should be used in QObject::connect
to specify this signal or slot.
pub fn is_operator(&self) -> bool
[src]
Returns true if this method is an operator.
pub fn all_involved_types(&self) -> Vec<CppType>
[src]
Returns collection of all types found in the signature of this method,
including argument types, return type and type of this
implicit parameter.
Trait Implementations
impl Debug for CppMethod
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for CppMethod
[src]
fn eq(&self, __arg_0: &CppMethod) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &CppMethod) -> bool
[src]
This method tests for !=
.
impl Eq for CppMethod
[src]
impl Clone for CppMethod
[src]
fn clone(&self) -> CppMethod
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more