Enum opencv_binding_generator::Func
source · pub enum Func<'tu, 'ge> {
Clang {
entity: Entity<'tu>,
custom_rust_leafname: Option<Rc<str>>,
gen_env: &'ge GeneratorEnv<'tu>,
},
Desc(Rc<FuncDesc<'tu, 'ge>>),
}
Variants§
Implementations§
source§impl<'tu, 'ge> Func<'tu, 'ge>
impl<'tu, 'ge> Func<'tu, 'ge>
pub fn new(entity: Entity<'tu>, gen_env: &'ge GeneratorEnv<'tu>) -> Self
pub fn new_ext( entity: Entity<'tu>, custom_rust_leafname: Option<Rc<str>>, gen_env: &'ge GeneratorEnv<'tu> ) -> Self
pub fn new_desc(desc: FuncDesc<'tu, 'ge>) -> Self
sourcepub fn set_custom_rust_leafname(
&mut self,
custom_rust_leafname: Option<Rc<str>>
)
pub fn set_custom_rust_leafname( &mut self, custom_rust_leafname: Option<Rc<str>> )
Sets custom rust_leafname for this func, used to disambiguate function names
pub fn custom_rust_leafname(&self) -> Option<&str>
pub fn specialize(self, spec: &HashMap<&str, TypeRefFactory>) -> Self
sourcepub fn is_specialized(&self) -> bool
pub fn is_specialized(&self) -> bool
Returns true if function was specialized
It’s used to add the return type to function identifier because otherwise it will generate identical function names when we specialize only on the return type.
pub fn kind(&self) -> Cow<'_, FuncKind<'tu, 'ge>>
pub fn constness(&self) -> Constness
pub fn is_abstract(&self) -> bool
pub fn is_generic(&self) -> bool
pub fn return_kind(&self) -> ReturnKind
pub fn safety(&self) -> Safety
pub fn is_default_constructor(&self) -> bool
pub fn is_clone(&self) -> bool
pub fn is_no_discard(&self) -> bool
pub fn return_type_ref(&self) -> TypeRef<'tu, 'ge>
pub fn has_arguments(&self) -> bool
pub fn num_arguments(&self) -> usize
pub fn arguments(&self) -> Cow<'_, [Field<'tu, 'ge>]>
pub fn generated_types(&self) -> Vec<GeneratedType<'tu, 'ge>>
pub fn identifier(&self) -> String
pub fn func_id(&self) -> FuncId<'_>
pub fn cpp_body(&self) -> &FuncCppBody
pub fn rust_body(&self) -> &FuncRustBody
pub fn cpp_call_invoke(&self) -> String
pub fn cpp_return( &self, ret: &str, ret_cast: Option<Cow<'_, str>>, ocv_ret_name: &str ) -> Cow<'static, str>
Trait Implementations§
source§impl Element for Func<'_, '_>
impl Element for Func<'_, '_>
fn exclude_kind(&self) -> ExcludeKind
fn is_system(&self) -> bool
fn is_public(&self) -> bool
fn doc_comment(&self) -> Cow<'_, str>
fn cpp_namespace(&self) -> Cow<'_, str>
fn cpp_name(&self, style: CppNameStyle) -> Cow<'_, str>
fn update_debug_struct<'dref, 'a, 'b>( &self, struct_debug: &'dref mut DebugStruct<'a, 'b> ) -> &'dref mut DebugStruct<'a, 'b>
source§impl RustElement for Func<'_, '_>
impl RustElement for Func<'_, '_>
fn rust_module(&self) -> Cow<'_, str>
fn rust_name(&self, style: NameStyle) -> Cow<'_, str>
source§fn rust_leafname(&self, _fish_style: FishStyle) -> Cow<'_, str>
fn rust_leafname(&self, _fish_style: FishStyle) -> Cow<'_, str>
The very last concrete part of the name in Rust Read more
fn rendered_doc_comment_with_prefix( &self, prefix: &str, opencv_version: &str ) -> String
fn rust_module_reference(&self) -> Cow<'_, str>
fn rendered_doc_comment(&self, opencv_version: &str) -> String
source§impl RustNativeGeneratedElement for Func<'_, '_>
impl RustNativeGeneratedElement for Func<'_, '_>
fn element_safe_id(&self) -> String
fn gen_rust(&self, _opencv_version: &str, _gen_env: &GeneratorEnv<'_>) -> String
fn gen_rust_exports(&self, _gen_env: &GeneratorEnv<'_>) -> String
fn gen_cpp(&self, _gen_env: &GeneratorEnv<'_>) -> String
source§fn element_order(&self) -> u8
fn element_order(&self) -> u8
Element order in the output file, lower means earlier
Auto Trait Implementations§
impl<'tu, 'ge> !RefUnwindSafe for Func<'tu, 'ge>
impl<'tu, 'ge> !Send for Func<'tu, 'ge>
impl<'tu, 'ge> !Sync for Func<'tu, 'ge>
impl<'tu, 'ge> Unpin for Func<'tu, 'ge>
impl<'tu, 'ge> !UnwindSafe for Func<'tu, 'ge>
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
Mutably borrows from an owned value. Read more